I'm attempting to open a SQLite database in android, the database works fine within the sqlite browser, but android doesn't read the table under consideration is available. Below may be the code I am trying out.

public String setColorName() {
    String colorName = null;
    try {
        db = this.openOrCreateDatabase("colors.db",MODE_WORLD_READABLE, null); 
        Cursor cursor = db.rawQuery("SELECT colorName FROM Colors WHERE RGB = '000000'", null);
        if (cursor != null) {
            if (cursor.moveToFirst()){
                do {
                    colorName = cursor.getString(cursor.getColumnIndex("colorName"));
                }while (cursor.moveToNext());
        } else {
            colorName = "woops";
    } catch (NumberFormatException e) {}

    return colorName ;

I've discovered many articles in regards to this problem on several forums (including stackoverflow) however the problem I am getting did not appear to obtain resolved using their solutions. I am attempting to pull the RGB and colorname in the code (the query above is simply a test prior to that) to ensure that I'm able to estimate the closest RGB while using euclidean distance formula on each portion. To be able to do this, I have to have the ability to atleast grab the information in the table :P.


    I/Database(12748): sqlite returned: error code = 1, msg = no such table: Colors
D/AndroidRuntime(12748): Shutting down VM
W/dalvikvm(12748): threadid=1: thread exiting with uncaught exception (group=0x4
E/AndroidRuntime(12748): FATAL EXCEPTION: main
E/AndroidRuntime(12748): android.database.sqlite.SQLiteException: no such table:
 Colors: , while compiling: SELECT colorName FROM Colors WHERE RGB = '000000'
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteCompiledSql.nat
ive_compile(Native Method)
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteCompiledSql.com
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteCompiledSql.<in
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteProgram.<init>(
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteQuery.<init>(SQ
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteDirectCursorDri
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteDatabase.rawQue
E/AndroidRuntime(12748):        at android.database.sqlite.SQLiteDatabase.rawQue

And lastly, here is a picture from the SQLite browser showing the query works on that database SQLiteBrowser Query

Incase the image did not provide away, I am storing the colours.db in assets.

Sorry for that length, I play the role of as thorough as you possibly can and seriously appreciate anybody who helps me.

Ok, it appears like I acquired beyond the problem. I desired copying the db from assets after which open it up after that. I wound up creating a database assistant while using information I based in the link below and that i got the database to prevent coming back that error, though Now i have to complete the relaxation from the application. Thanks a lot for the great advise, everybody! http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

Out of your screenshot it seems you will find the colors.db inside your assets directory.

While I don't know just how to load a SQLite db after that, I know that automatically the SQLiteDatabase android assistant object reads and creates towards the protected data folder from the application. So that your openOrCreateDatabase technique is invoking a create. However it tanks around the query since the table does not appear in this freshly minted db.

I am sure another person or perhaps a little searching might help resolve this.

You're creating the database and then you want to gain access to the table from this. Don't you have to produce the tables too? I'd suggest you to employ SQLiteOpenHelper rather than openOrCreateDatabase which means you will not encounter this issue.
Should you wanna access a current database through assets (as I have seen in your screenshot), you can make reference to SQLiteException: no such table