Category : pojo

Firebase query returns value {nfxQ14lxSIZ0qgTGllZ297b0nTv2={display_name=Friends, token= token_value}} The item is caught by the model class UserInfo userInfo = snapshot.getValue(UserInfo.class); userInfo.getDisplay_name() However, returns null Model class public class UserInfo { @SerializedName("display_name") private String display_name; @SerializedName("token") private String token; public UserInfo() {} public String getDisplay_name() {return display_name;} public void setDisplay_name(String display_name) { this.display_name = display_name;} public String ..

Read more

How do I store Object that have other Objects as Instance Variable in an android SQLite database. Basically, I have my JSON response from Rest Api call to look like: { "announcements": [ { "courseId": "196014605914", "id": "269865109791", "text": "Ignore the previous link. Join the already started CHM 112", "state": "PUBLISHED", "alternateLink": "https://classroom.google.com/c/MTk2MDE0NjA1OTE0/p/MjY5ODY1MTA5Nzkx", "creationTime": "2021-02-08T09:18:05.420Z", ..

Read more

In my app i have a Database with 2 tables Messages and MessageQueue. The schema is designed so that every message "holds" many MessageQueues. So we have a one-to-many relation. @Entity(tableName = "messages") data class Message( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "client_message_id") var clientMessageId: Long, @ColumnInfo(name = "message_id") var messageId: String, @ColumnInfo(name = "body", defaultValue ..

Read more

I have two entities in my room database in an Android application. The concept is that every Site has many Groups. @Entity(tableName = "sites") data class Site( @ColumnInfo(name = "server_id") var serverId: Long, @PrimaryKey @ColumnInfo(name = "site_id") val siteId: Int, @ColumnInfo(name = "description", defaultValue = "") val description: String ) @Entity(tableName = "groups") data class ..

Read more

I have two tables sites and groups with the data classes like that @Entity(tableName = "sites") data class Site( @PrimaryKey @ColumnInfo(name = "site_id") val siteId: Int, @ColumnInfo(name = "description", defaultValue = "") val description: String ) @Entity(tableName = "groups") data class Group( @PrimaryKey @ColumnInfo(name = "group_id") var groupId: Int, @ColumnInfo(name = "site_id") val siteId: Int, ..

Read more

I receive JSON data in this format from my API using Retrofit: { "id": "8dfa4c16-60d7-43ed-9292-21f12a4b7f48", "name": "Salon Ultra", "lat": 0.36992, "lng": 32.668261, "address": "Level 3, Garden City", "opening_time": "09:00:00", "closing_time": "20:00:00", "rating": 4, "whatsapp_contact": "+256701882716", "primary_contact": "09:00:00", "secondary_contact": "09:00:00", "img_url": "hair.jpg", "services": [ { "service_id": "1e3b47f5-f915-410d-9a76-a018e83ff4b1", "service_name": "Classic Locs", "service_price": "150000", "s_img_url": "img_locs.jpg", "s_service_provider_id": "8dfa4c16-60d7-43ed-9292-21f12a4b7f48", ..

Read more