Questions tagged [android-database]

General programmatic usage of databases on Android

Databases and tools related with persistence supported by the Android operating system.

584 questions
2
votes
0 answers

Room Migration Error

I have used a model inside a model in my app's Room Database. It is like this: I have a PackageModel @Entity public class PackageModel { @PrimaryKey (autoGenerate = false) @NonNull String package_id; String location mobil,isChecked; And another…
The Bat
  • 1,085
  • 1
  • 13
  • 31
2
votes
2 answers

Unable to query database in Android

I am trying to make the cart of a shopping app where I first query a cart element and from the id of a cart, list element find the corresponding meta-data related to the product by querying another table containing product information. I am able to…
2
votes
0 answers

Use Selection and Selection Args instead of URI matcher

I am confused the whole point of using URI matcher is to identify whether we want to work on particular row or the whole table. so in case we want to work on particular row with id "ID" we attach id to the path of URI and then URI matcher will…
2
votes
1 answer

Room Flowable does not emit data on insertion

I am having difficulty understanding how Flowable works in Room. I have Dao methods like this @Insert(onConflict = OnConflictStrategy.REPLACE) void upsert(List sites); @Query("SELECT * FROM site ORDER BY distance ASC") Flowable>…
2
votes
0 answers

SQLiteCommandBuilder returns error Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information

can you please help me. I have created a table and now I want to generate the Update command with SQLiteCommandBuilder. But the Commandbuilder fails with Dynamic SQL generation is not supported against a SelectCommand that does not return any base…
2
votes
1 answer

Room database architecture entity extends error

While using android Room i'm having the following entity: @Entity public class Call implements Parcelable { @PrimaryKey(autoGenerate = true) private long id; private String filePath; private long durationInMillis; private String…
2
votes
1 answer

Android App stops responding for SQLCipher

I have just changed my database from SQLite to SQLCipher. And my app became unbelievably slow. It takes ages to take click actions. I studied and found out these two possible reasons: Do not repeatedly open and close connections, as key derivation…
2
votes
3 answers

Get ID from database onClick ListView

I'm using SQLite in my app. I have a listView which is populated with values from the database. When I click on an item from the listview, I go to another page, and I would like ( with an intent), to transfer the ID FROM THE DATABASE. The problem is…
David
  • 221
  • 3
  • 13
2
votes
2 answers

how to sync android contacts with firebase database

I am new to android programming and I am Developing an App in which the user has an account in firebase and he wants to sync his/her mobile phone contacts with the firebase database contacts. One way is to get all the firebase contacts and compare…
2
votes
3 answers

How to secure android database file?

I have a problem. I am using xyz.db file and which is stored in asset folder. I am copying all data from xyz.db to application db which is stored in data/data/com.xyz/abc.sqlite in storage folder. Now I want to secure asset's xyz.db file. Because It…
user4570857
2
votes
0 answers

Android - Structure of classes for DB Tables + POJO Class can be same?

I have 25+ tables and I have used Content Provider with Database. I have created separate files for each tables with following structure: TProductUnit.java in package of com.myapp.db.tables public class TProductUnit { /*** * Fields of…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
2
votes
3 answers

How to insert existing DataBase in Android Project

I would like to insert an existing SQLite database into my Android project. In other words, I do not want to create it, but just to be able to access it within my app. How would I be able to access the database, and in which folder should I put it?
Thomas
  • 51
  • 4
2
votes
1 answer

How to upgrade database with Sugar Orm?

I have a simple entity: public class MyEntity extends SugarRecord { String name; int value; public MyEntity() { //empty ctr for sugar orm } public MyEntity(String name, int value) { this.name = name; …
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
2
votes
2 answers
2
votes
1 answer

Android - Realm How to get value

I'm trying to get a value I have saved in Realm, but I don't know how to do it.. the value is always null.. but when I'm debugging the code, the value appear as you can see in the image below: Note: BookMarkActive & idBookMark has the proper value…
gon250
  • 3,405
  • 6
  • 44
  • 75