Simple tutorial to calculate the amount of data / rows contained in sqlite database in android. The amount of data / row one known to be useful if the data you want inserted already exists, if it exists, it is not necessary to add, if not, then it can be added. But I was not that far, just to check course :)
As we know that to get the results of the query in sqlite in android using Cursor. And as to the general query, that to count the number of rows by using the count (*). So its shape code something like this :
public void count(){
SQLiteDatabase db = table.getWritableDatabase();
String count = "SELECT count(*) FROM table";
Cursor mcursor = db.rawQuery(count, null);
mcursor.moveToFirst();
int count = mcursor.getInt(0);
System.out.println("NUMBER IN DB: " + icount);
}