Questions tagged [android-room]

For questions related to Android Room Persistence Library (which is a part of Android Architecture Components)

Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

6786 questions
2
votes
0 answers

Room: Database Folder and Files no longer generated in WearOS App

I developed a project on Wear OS, And it worked until two days ago. The room database showed the files, And the folder, And after verifying the program, And whether it ran correctly, I decided to delete the folder and the files in the Wear OS…
leddev
  • 21
  • 4
2
votes
0 answers

Room database relation not applying

I can't make the relation between these entities. with SQL query I can make relation but with room not working. I think this a room bug but don't know why. and taking me a lot of time. using 2.2.6 version. @Entity data class Movie( …
Pejman Azad
  • 165
  • 1
  • 11
2
votes
2 answers

Cannot pre-populate room database when changing schema

I am at my wits end with a problem I cannot resolve - when trying to change the schema/data of a table in my database. I am pre-populating the database with Rooms .createFromAsset method. Current schema and data (working) - as shown in DB Browser -…
2
votes
1 answer

Is there a way when Migrating a Room Database to use Variables that are calculated during the Migration?

I'm writing an Android App in Java and I've changed my Database and now I want to migrate it to the new version but to do that I need to compute some of the old values and then insert those into one of the new tables into the db but when I…
2
votes
1 answer

Room (266) statement aborts disk I/O error

After i insert fastly X records in my database the app at certain point crash with the following stack trace: 2021-03-17 15:25:22.766 26711-26827/it.gabtamagnini.visualstock E/SQLiteLog: (266) statement aborts at 34: [SELECT * FROM corpo WHERE…
NiceToMytyuk
  • 3,644
  • 3
  • 39
  • 100
2
votes
1 answer

Search query design for two-way dictionary app

I'm currently developing a two-way dictionary application for Android using SQLite + Room. By two-way, I mean a user can search in either language and obtain relevant results. A key feature I would like to implement is to allow the user to not have…
1729
  • 137
  • 6
2
votes
1 answer

Why doesn't my Android ViewModel's Room RxJava3 Flowable publish any result when my Activity is paused?

I'm aware it's a complex question that cannot have a definite answer without posting a few hundreds of lines of code, which is why I'm looking for help through general ideas and pointers. I have a Room @Query returning a RxJava3 Flowable>…
Pat Lee
  • 1,567
  • 1
  • 9
  • 13
2
votes
2 answers

Kotlin Room Error "Cannot figure out how to save this field into database" With TypeConverters

I have the following Kotlin class that I'm using as a Room entity @Entity(tableName = "subscriptions") data class Subscription(@ColumnInfo(name = "title") var name: String, @ColumnInfo(name =…
owenlejeune
  • 135
  • 1
  • 7
2
votes
2 answers

Room database is still alive after deleting database

I've deleted the room database but still, I can see the previous rows in my database inspector unless I kill the app manually and reopen it. The scenario is logging out and reopen the login activity. The code snippet: class…
TinaTT2
  • 366
  • 5
  • 17
2
votes
1 answer

how to enhance & increase performance to recyclerView adapter

I have this adapter which work pretty good so far as expected but I have made some bad practice code on it like : -using onClickListener in OnBindView. used GC to clean my memory which is also a bad practice. I have set the adapter with a list and…
2
votes
1 answer

Saving Multiple Nested lists into room database

I'm working on dictionnary application in which the api request have many nested lists , i have tried to insert all the nested lists but i'm getting different error each time , i would like to know what is the best way to save multiple nested lists…
Taki
  • 3,290
  • 1
  • 16
  • 41
2
votes
1 answer

How can I make the LiveData getValue() function return the list of items from my rooms database in Android?

I have a getAllFlights() method in my ViewModel class which is supposed to return all the flights in my rooms database, however, when I call the method in my activity, it returns null even though I have flights existing in the database. Below is the…
2
votes
5 answers

I am facing this error A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

In my app I have a model class, it has some variables, I can call and show this data in this app using retrofit and room DB. which means this app first collects data from the server then it shows in room DB. But when I am using the list in this…
Adev
  • 43
  • 1
  • 1
  • 7
2
votes
0 answers

Android Room: Constructor error with embedded List

I get this common Error: error: Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type). - java.util.List I browsed across the answers and…
2
votes
0 answers

Support workaround for NOT IN max variable limit in Android DAO

I have a DAO database for the app. To delete some data in the database, I need to use WHERE NOT IN clause for some of my queries. DAO Interface code as follows: @Query("DELETE FROM layer WHERE userId = :userId AND lid NOT IN (:layerIDs)") fun…
GoldCat
  • 81
  • 1
  • 6
1 2 3
99
100