ICT 2612
ASSIGNMENT 3
MORTGAGE HOME
LOAN INTEREST APP
2021
COMPLETED PROJECT
SKELETON WITH
SOURCE CODE
,DISCLAIMER
I wont be held
accountable for
whatever mark the
user of this document
gets whether they
have failed or
passed,Purchase at
your own risk!!!
,
,
,
, MAINACTIVITY.JAVA
package com.example.mortgagehomeloaninterestapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
database myDb;
functions f = new functions();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EditText yl = (EditText) findViewById(R.id.youtubeLink);
EditText y2 = (EditText) findViewById(R.id.yearlink);
EditText y3 = (EditText) findViewById(R.id.monthlylink);
Button button = findViewById(R.id.button);
myDb = new database(this);
myDb.deleteData("0");
myDb.insertData("0","1","1","1");
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (f.EmptyFields(yl,y2,y3)){
return;
}else{
WriteBtn(yl,y2,y3);
}}
});
}
public void WriteBtn(EditText x,EditText y,EditText z) {
Toast.makeText(getApplicationContext(),x.getText(),Toast.LENGTH_SHORT).show();
myDb.updateData("0", x.getText().toString(),
y.getText().toString(),z.getText().toString());
startActivity(new Intent(MainActivity.this,results.class));
}
}