Menu
support@authoritypapers.com
+1(805) 568 7317

hello im going to attach some completed android studio code that i vewritten i want 4948977

Hello Im going to attach some completed Android Studio code that i’vewritten. I want from you a new perspective on it. I want you toshow another example how it could be written. So I got an app which stores ID,name, and Salary of a person,and is connected to SQlite database. So I will provide you theDatabase code and the MainActivity, I want you to change theMainactivity, if its impossible to change it without also changingDatabase, give it a shot. Thank you. Please comment the code
DATABASE Code
public boolean ModidifyData (String id, String Name, String Salary) { SQLiteDatabase db =
this.getWritableDatabase(); ContentValues contentValues =
new ContentValues(); contentValues.put(
COLUMN_ID, id); contentValues.put(
COLUMN_NAME, Name); contentValues.put(
COLUMN_SALARY,Salary); db.update(
TABLE_NAME,contentValues,
“ID = ?” ,
new String[]{id});
return true;
MainActivity modifyButton.setOnClickListener(
new View.OnClickListener(){ @Override
public void onClick(View v) {
if (
ID.getText().toString().trim().length() == 0) { Toast.
makeText(MainActivity.
this,
“Type in a ID number”, Toast.
LENGTH_SHORT).show();
return; }
boolean update =
dbHandler.ModidifyData(
ID.getText().toString(),
Name.getText().toString(),
Salary.getText().toString());
if (update) { Toast.
makeText(MainActivity.
this,
“Update successful”, Toast.
LENGTH_SHORT).show();
ID.setText(
“”);
Name.setText(
“”);
Salary.setText(
“”); }
else { Toast.
makeText(MainActivity.
this,
“Failed updating”, Toast.
LENGTH_SHORT).show();
ID.setText(
“”);
Name.setText(
“”);
Salary.setText(
“”); } }}); . . .

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now