For that existence of me, I can not obtain the cursor to come back data. I have verified their is data within the database and my insertions will work. The state error is:

CursorIndexOutOfBoundsException: Index asked for, having a size

Top level terms:

private DatabaseHelper DBHelper;
private SQLiteDatabase db;

public DBAdapter(Context ctx) 
{
    this.context = ctx;
    DBHelper = new DatabaseHelper(context);
    this.db = this.DBHelper.getWritableDatabase();
}

My function:

public String getRandomEntry()
    {
    int rand;
    Random random = new Random();
    int numEntries = (int)this.getCount();

    if(numEntries == 0)
        return "ERROR: Database is empty.";
    rand = random.nextInt(numEntries);

    Cursor cursor = DBHelper.getWritableDatabase().rawQuery(
            "SELECT * FROM " + DATABASE_TABLE 
            + " WHERE " + COLUMN_A + " = " + 0, null);

    Log.i("numEntries", Integer.toString(numEntries));
    Log.i("rand", Integer.toString(rand));
    Log.i("cursor", Integer.toString(cursor.getCount()));

    cursor.moveToFirst();
    return cursor.getString(0);
}

I have also attempted getting the cursor as a result:

Cursor cursor = db.rawQuery(
            "SELECT * FROM " + DATABASE_TABLE 
            + " WHERE " + COLUMN_A + " = " + 0, null);

Please produce your ideas! Thanks!!

Nothing appears random here whatsoever. It seems that you're searching for column_a having a worth of each time.

I'd think that column_a is not having a worth of .

To begin with attempt to query by doing this:

String args[] = new String[]{"0"};

Cursor cursor = db.rawQuery(
        "SELECT * FROM " + DATABASE_TABLE + " WHERE " + COLUMN_A + " = ?", args);

If the not helps look at your db with exterior tool should you query return rows there.