I am trying to create a SQLite database within my android app, but my code consistently throws a \"SQLiteException\" saying that no such table exists. I am new to SQL, but I
It works fine in my computer with your code. so I guess that you change the TABLE name during your development. and just run the program again with eclipse's RUN command. So the application was not a fresh install. but you don't implement the onUpgrade() correctly.
to solve your problem you met quickly.
Have you made changes to the table after you initially created it (meaning run it on your phone/emulator)? Like maybe adding a new table, or changing the name of it?
If so, you need to change your DATABASE_VERSION
to 2 so that the database will be upgraded to your latest schema.
And KEY_FAVORITE + " bit, "
needs to be KEY_FAVORITE + " integer, "
. And if you make that change, you need to update your DATABASE_VERSION too.
Basically for anything that makes a change to the structure of the database you need to increase the version so the database will re-create the database with your new changes.