Category "android-room"

Room database reset to default values which was set by prepopulating database when clearing app from background

I have a database which is prepopulated with some tables which is working fine. I have prepopulated my db. like this Room.databaseBuilder( get(),

Room database - edit entities

I have a question. I edited my Room entity from this: @Entity(tableName = "users") public class User { public User(String username, String email, String passwo

Android custom keyboard suggestions

I am building a custom keyboard for android, the one that atleast supports autocomplete suggestions. To achieve this, I am storing every word that user types (n

Room database - edit entities

I have a question. I edited my Room entity from this: @Entity(tableName = "users") public class User { public User(String username, String email, String passwo

Single or multiple DAO and Repository in Android Room database project?

I have a Room database project which has a DAO and a Repository (mediator between different data sources) for each table in the database. It is a lot files and

How to add/remove characters inside TextField?

I have a Room database with a table that holds users. Each user has an ID and a name. My goal is to change the name of the user based on the ID. Here is what I

Room field / getter mismatch warning when using sealed classes or Any

I have a Room (v2.4.0-beta01) database, and whilst it works fine, during the build it gives a field vs getter mismatch warning on a few fields, included below.

Error while using suspend with DAO methods

I am getting a compilation error that I have described below. I have tried different solution provided on similar question like mine but neither of them worked

What to send as Content

In my application, I save data to Firebase and to local storage using the Room library. With Firebase, everything is clear to me. But with Rom I had questions.

Using UUID for Primary Key using Room with Android

I need to sync my Android mobile app with a multi-tenant database in the cloud. I thought the best way to do this was using a UUID for the Primary Key of my tab

Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64

I am using Android Studio [Android Studio Arctic Fox | 2020.3.1 Patch 1] My room library version is [2.3.0] Used Gradle version [7.0.1] Also added kapt 'org.xer

Store data and "Cannot create an instance of class ViewModel" - Hilt - Room - JetpackCompose

I try to store some days from ScheduleScreen screen. Lib uses in theme topic. While I was doing this, I had two questions: why i got this error Cannot create an

Room database onConflict = OnConflictStrategy.REPLACE not working

I am working on Room database and trying to insert list of items(eg. list of Quotes which contains author name and a quote in my case). Following is the code I

Room Dao LiveData as return type causing compile time error

I am using Room and implemented Dao that returns LiveData. It was working fine with below dependency added. implementation "androidx.room:room-runtime:2.1.0-al

Caused by java.lang.IllegalStateException: Couldn't read row 281, col 0 from CursorWindow with Room

I am getting this exception with my DAO in Room, at what seems random moments: Caused by java.lang.IllegalStateException Couldn't read row 281, col 0 from Curs

Room Database Table is still empty after inserting new data

I've just finished this tutorial for my app. But my problem is that even after I insert the data, my database is still empty. I checked that by viewing it in a

How to highlight SQL syntax of Room Dao in Android Studio

With new Room, How to highlight SQL Syntax in Dao Interfaces? For example @Query(SELECT * FROM user) is it possible to highlight the words SELECT, FROM with a

How to filter a nested relation in Room?

Let's take this example: I have a form, which has several sections, each having questions. Sideways, I have answers that are mapped to questions and they have a

This Error Force close my app when I'm inspecting my table : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10

I have table in my application and I'm Running my app on Huawei y9 and this error pops up after a 30 sec and force close my application. I link my other questio

Room Persistence: Error:Entities and Pojos must have a usable public constructor

I'm converting a project to Kotlin and I'm trying to make my model (which is also my entity) a data class I intend to use Moshi to convert the JSON responses fr