Questions tagged [android-database]

General programmatic usage of databases on Android

Databases and tools related with persistence supported by the Android operating system.

584 questions
6
votes
6 answers

Android: Delete entire database

I would like to delete a complete database created by my application. Do you know any adb command, or android sentence to do it?
Sosi
  • 2,578
  • 8
  • 39
  • 49
6
votes
4 answers

Accessing the database of one application from another application

I've built an application and now I want to copy the database of that running application using my new backup application. I create my database path by doing DB_PATH + DB_NAME, using the following values: DB_PATH = "/data/data/iCam.Cam/"; DB_NAME =…
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
5
votes
1 answer

Room Database TypeConverter is not used in some collections e.g. Set of String

So I have this data object, that has a set of strings (representing non-indexable keywords but that doesn't matter here) as a member and Room does not behave well when this set is empty: @Parcelize @Entity(tableName = TABLE_NAME) data class…
ThePMO
  • 413
  • 4
  • 13
5
votes
0 answers

RoomDatabase - Could not allocate CursorWindow of size 2097152 due to error -24

i am developing an android application using Room Database link for saving data locally. In simple query, it worked properly. However when i loop through a list of data to save locally, i get CursorWindowAllocationException. By googling i should…
JDevs
  • 101
  • 1
  • 11
5
votes
1 answer

Android Room: DAOs bigger than 1048576

I have 11Mb JSON file and these file will be write on Dao but when I save all data. I got this error; /data/user/0/com.test.save/databases/ChannelDb-wal 6946352 bytes: Bigger than 1048576; truncating My codes; AppDatabase dbRoom =…
secret
  • 742
  • 1
  • 7
  • 24
5
votes
1 answer

Android BroadcastReceiver Database Access with Room

I have setup an alarm that calls each hour a broadcast receiver. This receiver tries to load data from the sqlite database. The problem is, that the list of reminders is null. The same codes works in an activity, but not in the receiver. Is there…
5
votes
1 answer

Android - Supertypes of the following classes can not be resolved - (Room Persistant Library, Android Library Module)

In my Android project (Kotlin), I want to use Room persistent library for my DATA LAYER. But when I added dependencies for Room Persistent library suddenly build projects start failing. Error which I am receiving: Here is my project level…
Mohit Charadva
  • 2,555
  • 1
  • 22
  • 30
5
votes
1 answer

Room Persistence library - Nested Object with List

I have a VideoList object which I want to save using room library but when i try to use @Embedded with public List list = null; it is giving me below error: Error:(23, 24) error: Cannot figure out how to save this field into database. You can…
Amit Patel
  • 1,795
  • 16
  • 20
5
votes
2 answers

How to convert video/audio file to byte array and vice versa in android.?

Am trying to convert audio/video to byte array and vice versa, using below code am able converting audio/video files to byte array(see below code) but am fail to convert large file(more then 50MB files) is there any limit.? how to convert byte…
chethankumar
  • 409
  • 2
  • 5
  • 15
4
votes
1 answer

Is it normal for Android Room to be storing the prepackaged database in cache?

I'm currently creating an Android application that uses a prepackaged database. The database is initially around 40MB in size and is stored in the assets/databases folder. The Problem When I look up how much space my application is using, the "App…
4
votes
0 answers

Sqlite Query to MATCH Multiple Words in FTS4 Table Android

I am trying to do this query in android FTS4 table and this works perfectly: SELECT * from table WHERE table MATCH 'description: paint* OR alias: paint*' I need to match multiple words in multiple columns like this: SELECT * from table WHERE table…
Aayush Thakur
  • 634
  • 1
  • 10
  • 22
4
votes
1 answer

How to use HashMap for this scenario?

Given the client requirement task to do. • Create Vehicle class which includes vehicle Id(Integer) as vehicle number and lot(Integer) as parking lot number. Implement getId() and getLot() that returns vehicle Id and Lot. Create ParkingLot…
4
votes
2 answers

How to pass Data Objects from Room DB to WorkManager class

There is the dialog that saves an object to the Room database. The dialog should wait for saving to the database in order to run a special Worker class, that will retrieve this object from the database by ID and do some work with it. But this…
4
votes
1 answer

Printing a Realm Query

I am migrating my existing project's database from SQLite to Realm. So there is a way to print Query like we can get/print in SQLite. SQL Query: select * from Patient where "revision=8" and (long_description like="%bone%" or code like="%bone%")…
Mehta
  • 1,228
  • 1
  • 9
  • 27
4
votes
1 answer

How to bulk insert or update in sqlite android?

Let me explain my problem precisely i just want to insert 1000's of records in a single shot but it taking some time having some performance issue, is there anyway to improve the performance while doing insert or update operation. Let me explain…
M.Yogeshwaran
  • 1,419
  • 4
  • 22
  • 48
1 2
3
38 39