Skip to content
Advertisement

Tag: android-room

How can I make a ListView load parent and childs related by ForeignKey?

For now, I have a working ListView that successfully loads every “parent” object in the ListView, retrieving the parent attributes and showing them in every element. Due to I am trying to follow Android’s Model-View-ViewModel architecture patterns, I am using RoomDb, a Repository class and a ViewModel class (viewmodel class holds logic for both parent and children; I wonder if

For some reason my Android room DAO insert doesn’t work on Temi Robot

For some reason even after following some parts of the guide, I wasn’t able to insert a new entry to my database. retrival is okay. I don’t really want to do the respitory and viewmodel boilerplates as mentioned in the guide I have put the relevant dependencies in build.gradle already. I am using Java 11. TemiPatrolRoomDatabase.java: TemiPatrolDAO.java SettingsFragment.java: AudioFile.java Answer

Relations between Room Tables Android

I am developping a chat app. I have two Entities And In MessageDao I want to get Contact phone correponding to the contact_id in MessageItem Answer You have three ways you can do this. 1) You can use a POJO with an @Embedded and an @Relation in which case you return MessageItem’s with the Contact e.g. :- along with an

Merging multiple LiveData sources?

To make it easier to visualize my problem I drew the following: I am using a RoomDatabase, a Repository, a Viewmodel and Livedata. Areas have a 1 to n relationship with Gateways and Gateways a 1 to n relationship with Items. I created both an AreaWithGateways entity and a GatewayWithItems entity. Items can move from a gateway to another, which

Room database not created

I’m trying to develop an app with Room. The project is in java. This is my first time using Room. I’ve followed the documentation and created class with @Database, @Dao & @Entity. However when I run the app, it throws the following exception. Can someone please help me figure out what am I doing wrong here? I’ve spent a day

Advertisement