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
3
votes
0 answers

How can obfuscate Sqlite Database in android

I create External database with SQLite Expert Professional IDE and i insert many data into this database and i what add this database in my Android Project. but i want obfuscate this database. I want when other developers decompile my projects, not…
user7624048
3
votes
1 answer

SQlite: Data is only get inserted first time in table and second time it does not

The data we are inserting in table the first time it get inserted while on second time(like second entry)it does not, What should be possible reasons if you can not read and understand my code then we can discuss the reasons package…
blackHawk
  • 6,047
  • 13
  • 57
  • 100
3
votes
1 answer

How to override the interface methods in the generated database table class?

I am using GreenDao in my Android project and i have generated my database schema successfully but I am stuck on one issue. My generated class needs to implement an interface that is not related to db. In the generator I have used the following…
3
votes
2 answers

How to use Sugar ORM's count() method?

I have an Email_Message class in my android app that stores email messages. It has an int field called "messageType". messageType == 1 means it's an inbox email, messageType == 2 means it's a sent email. I just started with Sugar ORM and I want to…
logi0517
  • 813
  • 1
  • 13
  • 32
3
votes
1 answer

can i dynamically add new column to sqlite table by calling a method from another class?

I have a table in database, each record of this table needs to store multiple Strings, i dont know how many Strings because its decided at runtime. I want to add image uri's in database table dynamically, user dynamically add images in my app as…
3
votes
0 answers

Android - Reading EXIF information from file using ExifReader very slow

I have an image processing app which needs to remember which photos were already processed. The solution I came up with was to store a given String ("abc-"), into the EXIF MAKE tag. So, in order to filter the photos, my app needs to read the EXIF…
Ernestina Juan
  • 957
  • 1
  • 9
  • 24
3
votes
6 answers

Updating SQLite database when releasing new version of the android app on the store

I'm using sqlite in my android app, my database file is called data.db. Let's suppose that I have two table in it one is having static values(read only) and second is saves dynamic values and pushed the app to the playStore. In the next version I…
Pankaj
  • 346
  • 1
  • 3
  • 15
2
votes
1 answer

file explorer doesn't show any database

I am creating a login application in which data which is typed in EditText will get in a variable upon clicking on button in a java file and than that value will get stored into the sqlite database which I have created but when I typed value in…
Ashu
  • 21
  • 2
2
votes
3 answers

Android room database: get autogenerated id at time of assignment

I have an android database with an entity something like id (autogenerated) string filename 0 cow myFolder/0.mp3 3 sheep myFolder/3.mp3 In other words, I want to use the autogenerated id to be included in a filename once the entity has…
dlw
  • 103
  • 1
  • 8
2
votes
1 answer

How can I fix this error for view Model? (Occurs when running the program on the emulator)

Error running program on emulator: 2022-06-16 15:38:04.724 12519-12555/com.example.mvvm E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@5abc123 2022-06-16 15:38:04.725 12519-12555/com.example.mvvm…
2
votes
1 answer

(Android) How to match child ID to parent in one-to-many relationship

I'm working on an image-like, one-to-many database. To explain the flow of functions, WorkoutSetInfo is added to the list whenever the Add button is pressed. (It is not inserted into DB.) Finally, when the Save button is pressed, the Workout and…
ybybyb
  • 1,385
  • 1
  • 12
  • 33
2
votes
2 answers

Query one to many relationship Android Room

I have a one to many relationship. One Parent can hold many Child entities. The children have the property date, which is of type Instant. I have made a class which combines these two entities: data class Combined( @Embedded val parent: Parent, …
2
votes
0 answers

Room: Database Folder and Files no longer generated in WearOS App

I developed a project on Wear OS, And it worked until two days ago. The room database showed the files, And the folder, And after verifying the program, And whether it ran correctly, I decided to delete the folder and the files in the Wear OS…
leddev
  • 21
  • 4
2
votes
1 answer

How can I make the LiveData getValue() function return the list of items from my rooms database in Android?

I have a getAllFlights() method in my ViewModel class which is supposed to return all the flights in my rooms database, however, when I call the method in my activity, it returns null even though I have flights existing in the database. Below is the…
2
votes
2 answers

How to read a value from Room database via View Model, Repository and DAO?

I'm developing an Android app using Room database. I've already learnt to write values to database. As far as reading/fetching is concerned, I could get help only related to fetching whole list of values form the database (and populate them in a…