I have a database name "CUED" (sqlite Android)it have a table HELLO which contain a column NAME I can get the value to String from that column. Let me show you my code section
myDB =hello.this.openOrCreateDatabase("CUED", MODE_PRIVATE, null);
Cursor crs = myDB.rawQuery("SELECT * FROM HELLO", null);
while(crs.moveToNext())
{
String uname = crs.getString(crs.getColumnIndex("NAME"));
System.out.println(uname);
}
It will print the value one by one.Now what I need is that I want to get the column values from database and so that I can store it in a String Array.
This is my code that returns arraylist contains afield value:
Enjoy it
You already did the hard part... the array stuff is pretty simple:
Whatever, I always recommend to use collections in cases like this:
In order to compare the arrays, you can do things like this: