Category : sqlite

So I have a table called name_value in a database called cache.db. The database name has a dot in it. When I try to execute the select query in database, I get an error as follows android.database.sqlite.SQLiteException: no such table: cache.db.name_value (code 1 SQLITE_ERROR): , while compiling: SELECT name, value FROM `cache.db.name_value` at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6720) at ..

Read more

I would like to load an external database in Android. I have used the approach from with tutorial Read External Database with SQLiteOpenHelper on Android. I created an folder called "assets" in src/main/assets and I inserted the database ‘Test_DB’ there. Unfortunately, when I start the app I get the error message: Cannot open database ‘C:/Users/user/Projects/AndroidStudioProjects/Bapp/Bapp_Projekt/app/src/main/assets/Test_DB.db’: ..

Read more

I recently updated the Room library to 2.3.0-beta01 from 2.2.5. Here is the migration that I added. "CREATE TABLE ‘bookmark’ (‘id’ TEXT, ‘content_id’ TEXT NOT NULL, ‘bookmark_position’ INTEGER NOT NULL, ‘chapter_index’ INTEGER NOT NULL,’chapter_bookmark_position’ INTEGER NOT NULL, ‘bookmarked_at’ INTEGER NOT NULL, ‘bookmark_note’ TEXT, ‘content_type’ INTEGER NOT NULL, ‘title’ TEXT NOT NULL, ‘img_url’ TEXT, ‘sync_pending’ INTEGER ..

Read more

i was trying to prepopulate my Room Database but Android Studio says that it "cannot resolve method ‘createFromAsset()’ in ‘Builder’. I am using room version 2.2.6 and the function was implemented in version 2.2.0. package com.example.elementsfoodapp; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; import androidx.sqlite.db.SupportSQLiteDatabase; @Database(entities = {Food.class}, version = 2, exportSchema = false) ..

Read more