Questions tagged [room]

The Room persistence library provides an abstraction layer over the existing persistance layer (e.g. SQLite) to allow for more robust database access. The library helps you create a cache of your app's data on a device that's running your app. This tag implies you are using android, so maybe it's more useful to use it along with the tag for sqlite or whatever database you are using.

The Room persistence library for provides an abstraction layer over the existing persistance layer (e.g. ) to allow for more robust database access.

This library helps you create a cache of your app's data on a device that's running your app, keeping you from querying the actual database every single time.

Useful links

28 questions
0
votes
1 answer

Kotlin Room Cannot find getter for field

Task :app:kaptDebugKotlin FAILED E:\MobileProjects\NewsApp\app\build\tmp\kapt3\stubs\debug\com\appops\newsapp\models\Article.java:10: error: Cannot find getter for field. private java.lang.Integer id; [WARN] Incremental annotation processing…
Emre Memil
  • 233
  • 3
  • 5
0
votes
0 answers

Persisting server request in android

Is it a good choice if i persist server request data in database and manage them without any user interaction ? Is it good practice persisting requests at all ?
armin7298
  • 1
  • 3
0
votes
1 answer

LiveData not updating the UI (using ViewModel and Room Database)

so I'm using LiveData and ViewModel to set the function of getting and insert the data, and I'm using the Room database to save the data. after I inserting the data to the database my RecyclerView not updating the…
0
votes
1 answer

Best way to reset a database value every week on specific day (Android - Room)

I'm working on an Android app that has a functionality that is weekly basis, that is, every day of the week the user has to mark as done the day. This value is a boolean on my database, that is initialized with false, and is set to true when the…
ddeveloper
  • 53
  • 6
0
votes
3 answers

Room TypeConverter class fails to compile

I'm attempting to use the Room TypeConverter (Room version 2.2.5) for an enum, but while compiling I receive a Class is referenced as a converter but it does not have any converter methods. Looking at the Converter.java class, it is indeed missing…
0
votes
1 answer

java.lang.IllegalStateException: Migration didn't properly handle. Tables not changed

I have a problem when trying to write example test for room migration. When I run test i got above exception, however the table that causes the problem did not change between db versions. Expected: TableInfo{name='UserSettings',…
0
votes
1 answer

How to build and query a Room DB to return a list of objects of multiple classes?

Bear with me, it's a tricky question and what resources I've found around don't really help me resolve my problem. I'm trying to build a real estate-oriented app on Kotlin. It must show at some point a RecyclerView with multiple object classes (say:…
Emiliano De Santis
  • 197
  • 1
  • 3
  • 15
0
votes
1 answer

How to properly use Android Room in background tasks (unrelated to UI)

At the moment Room is working well with a DB to UI integration: Dao for DB operations Repository for interacting with the Daos and caching data into memory ViewModel to abstract the Repository and link to UI lifecycle However, another scenario comes…
Shadow
  • 4,168
  • 5
  • 41
  • 72
0
votes
2 answers

lateinit property remindersViewModel has not been initialized

I am displaying two fragments in the activity with recyclerViews. I am trying to add a new item to the recycler view but I am getting : "lateinit property remindersViewModel has not been initialized" error. I am already trying to initialise it in…
0
votes
0 answers

Rooms database save and retrieve object using converter

when i was trying to save an object using rooms database, data insertion was successful. while retrieving data, a value inside the object, which was an object, was retrieved as array. Converting the array back to object is not working. Other string,…
GhostMode
  • 37
  • 2
0
votes
0 answers

Android Room Database Optional paramater

I have an app on play store. I want to send a new update to play store but I have a doubt before sending the update. I made the parameters of my entitiy class in room to optional. Does this change require a database migration code? Thanks.
Badiparmagi
  • 1,285
  • 1
  • 14
  • 24
0
votes
0 answers

How to get values of LiveData from repository in viewmodel?

Quiz app, categories have questions and questions have answers. I have two queries in the DAO. In the first one, I get all the categories from the data: @Query("SELECT * from category_table ORDER BY category_id") fun getAllCategories():…
Tyler
  • 11
0
votes
1 answer

Error using @Embedded Tag when setting up Room Database

I am trying to use @Embedded in a data class in order to save subfields as columns in my Room Database. When I try to run my app I get this error: Expected BEGIN_OBJECT but was BEGIN_ARRAY My Data Class looks like this: @Entity( tableName =…
1
2