we get the tophere out, but it never gets to the downhere part in the log, so we are guessing something is causing it to fail there. we have tried everything, the 's are there to see where it fails. problem is, as far as we can tell, it doesn't create the tables, so when we try to insert into the tables and read from them, it crashes. We have this code for creating a database for an app. * onOpen method called when app is void onOpen(SQLiteDatabase db)ĭb.execSQL("create table if not exists "+DATABASE_NAME+"." + NotificationManager.getUserStatic(context) + "log ("+ KEY_TIME +" INTEGER primary key, "+ KEY_TEXT +" TEXT not null) ") Import static .execSQL("create table " + NotificationManager.getUserStatic(context) + "log ("+ Here is an example from a tutorial and an example on GitHub: import One way to implement SQLite testing is with an instrumented unit test, using the InstrumentationRegistry in the Android test package to obtain a Context. SQLiteDatabase db = this.getReadableDatabase() Ĭursor cursor = db.rawQuery("SELECT * FROM " + Table_Name, null) public class DatabaseManager extends SQLiteOpenHelper ) How do I go about this? This is the code for my database. I want to do unit tests for the insertNote, readNote and updateNote methods for the database. I'm new to android app development and I just made a note app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |