Java tutorial
//package com.java2s; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class Main { public static int getGroupCount(SQLiteDatabase db) { int count = 0; Cursor cursor = db.rawQuery("select count(*) from classlist", null); cursor.moveToNext(); count = cursor.getInt(0); cursor.close(); return count; } }