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
1
vote
1 answer

Unable to add ArrayList to internal database android and creating a recycler view

I am trying to create a recycler view after adding data via ArrayList to an sqlite database but I am getting null pointer exception while fetching the data from the database and displaying the recycler view via the adapter. Here is the code for my…
1
vote
1 answer

Deleting from a ContentProvider?

I want to delete the first item in my content provider. I'm trying to do this by deleting the row with id 0 (as shown below). This does not work--the app will not run with this code. public void onClickDeleteExercise(View view){ int ret_val =…
1
vote
1 answer

How to access main.db of Skype App to display Recent Tab logs in Sample Android Application?

I'm trying to make an Android Application in which i want to show the logs/Call History of Skype User(Recent Tab). As much as I know, Skype stores all the Contacts in a Server and after logging in for the first Time , it syncs All the Contacts using…
1
vote
2 answers

Handling database changes when app version number changes

I'm trying to figure out the best way to handle database upgrades and versioning. At the moment I delete the database and log users out when I do a point release, which isn't a great experience. Can anyone recommend any tips for doing this?
AndroidEnthusiast
  • 6,557
  • 10
  • 42
  • 56
1
vote
1 answer

SQLiteConstraintException: column id is not unique (code 19) exception when updating row

I have a table in my database, when adding new record I am checking if the record exists using the id.If it does, I want to update the record and if it doesn't add a new record. But am getting the exception: 2006-2259/? E/SQLiteDatabase﹕ Error…
Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
1
vote
0 answers

What is correct type for getDate in Cursor?

I dont know what is correct code to get date in the cursor as the error said: Cannot resolve constructor "Website(int, java.util.String, java.util.String)" My constructor is: public Website(int id, Date stamped, String url, String content){ …
1
vote
0 answers

Why is my second greendao insert not working?

I am using greendao for an application of mine. I used a generator to create all of the tables and I am running test right now. The insert is working for the user table, but not for the group table. There's little different between the two entity…
Kivo360
  • 781
  • 3
  • 9
  • 12
1
vote
1 answer

Android SQL Database ERROR (Code 1)

I'm trying to display the data from database one by one changing if next button is clicked. And I just wanted to check if the program could select the first data from the database but I get the error message. Caused by:…
Burak
  • 133
  • 2
  • 12
1
vote
0 answers

How to open a database (.crypt8) file?

I have to open a database (.crypt8) file in my computer. I followed this video, but this method it requires root access to work. How could I achieve this?
1
vote
0 answers

Take date from SQLite when network is not available

In my android application I use OpenWeatherMap service and I am new in android. I parsed JSON date to screen of my application but I am little bit comfused with SQLite cause I never worked with it and I use Fragment.(Many tutorials which I found was…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
0 answers

Diagnosing causes of android database lagging

I have an android database and the same call to the database sometimes takes >100 ms and sometimes 2 seconds. My app doesn't do anything different. 2 Seconds aren't really acceptable. How do I track down the source of the lag?
Christian
  • 25,249
  • 40
  • 134
  • 225
0
votes
1 answer

How to retrieve database id when clicking recycler view in android studio?

I've been working on an android app, and I need to get the database id when I click on specific row in the recycler view. When I wrote this app previously I updated and deleted the records based on their names, however when I came back to this…
0
votes
0 answers

Prepopulate Room database with Worker Hilt

I'm trying to prepopulate a Room database using a Worker injected by Hilt in the RoomDatabase.Callback(), but when I open the app and the first call requires data, it happens that returns an error and after to retry the prepopulate data appear. It…
0
votes
0 answers

How to evaluate Recyclerview in MVVM architecture

I am creating a Notes taking app. Where on the main screen I have a floating action button . When the user will click on that button a screen will open to take the title and description of the note. Then the note will add on the screen on a recycler…
0
votes
1 answer

room does not show and suggest table name when use query(SELECT * FROM table_name)

image 1 description : when I want to query : (https://i.stack.imgur.com/zniPt.png) image 2 description : the picture android developer has provided : (https://i.stack.imgur.com/6XXgb.png) When I query to select all my Items, it does not show my…