android sqlite - instantiate-create-insert-search for elements -


I am new to Android. I would like to create a database that will include a name and a phone number. Add me to this database.

Or need to modify the phone number element. Can anyone help me in creating a table with this two elements in the database and can check if a specific name exists or not. If someone does not want to add me, then they have to be added to the table. If the name exists, then I want to be able to modify the phoe number. I just want to make a table. I think I have to check whether the table has been created or not.

Can anyone give me a quick android example, to create, create, insert, delete, or modify elements in a database or search for elements? please?

Appreciate it. Thanks

Based on the example of the student database ( http://androidpartaker.wordpress.com/2011/07/03/introduction-to-android-sqlite-database )

I have:

  if (cursor! = Null) {while (cursor.moveToNext ()) {if (cursor.getString (1) .equals (" ")) Value = i; Logs. I ("Student", "Student's Name:" + CursorGetString (1) + "Grade" + CursorGet String (2)); I = I + 1; }} Cursor cursor 1 = dbUtil1.fetchStudent (value); If (cursor 1! = Null) {// while (cursor 1.moveToNext ()) {toast. Make Text (this, "Student" + "Student's Name:" + Cursor 1.getString (1) + "Grade" + Cursor 1. getString (2), Toast.LENGTH_LONG) .show (); // I = I + 1; }}   

But I am not working properly where am I wrong? Here is a very good introduction to Android SQLite database through a sample app:



Comments