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

A SQLiteConnection object for database was leaked

I am beginner to android program getting below error, tried solution provided like clearing Google play store data on Emulator still getting same error, not using any database connection code but getting database was leaked, any help would be…
1
vote
2 answers

how to add value into database taken from input alert dialog box

Its a game in which at the end activity the score is displayed But before that the input alert box is displayed where user need to add their name,and that name and score should go to the database. score is getting stored but not the name. how to get…
user7596752
1
vote
1 answer

ContentProvider not called onCreate after deleting database

I have created ContentProvider which creates one Database on application launching. Now In that application, I am doing process of deleting database when user logout from app. After that when I come again to login, the ContentProvider cant call…
1
vote
0 answers

How to do offline data backup of an Ionic 2 app (user data is stored using Couchbase Light)?

I am a beginner and developing an app using Cordova, ionic2 and Couchbase Lite for user data storage. I want the app to work offline. The app should be able to back up the data stored in the Couchbase Lite database to a specific location in the…
Yamini Sankar
  • 29
  • 1
  • 6
1
vote
3 answers

Android recyleview listing using with database not working

I am developing an app for listing details in database. The listing is not working. but it is showing in log as fine. Why my recyclerview listling is not working. when i am using bean1 = new Bean(cn.getName(), cn.getNumber(), cn.getSpeeddial()) it…
fazil tm
  • 299
  • 1
  • 5
  • 23
1
vote
1 answer

andorid-db query to get last records or first of the group if the last record is duplicate of previous

There is a table status that contains data as shown below: Id Status TimeStamp ------------------------- 1 StatusC 1234561 2 StatusC 1234562 3 StatusB 1234563 4 StatusA 1234564 5 StatusA 1234565 6 StatusA…
coder1087
  • 115
  • 1
  • 2
  • 9
1
vote
2 answers

passing data from one activity and displaying the database from the Main Activity

new to Java here :) The problem I'm facing is that I am unable to display the database from the Main Activity with a click of a button. The data in the database is being passed from another activity, would like to know if I'm missing anything or…
Adi
  • 13
  • 3
1
vote
2 answers

Realm and Android DataBinding

I'm trying to use Realm in my app, but without success. The problem seems to be the fact that i use databinding and Realm in the same application. The objectif, is let the user to use View to enter some data that i get with databinding, and insert…
kevingiroux
  • 155
  • 1
  • 14
1
vote
0 answers

Can I use the FireBase Rules Wild Card as a root

Ok I keep trying to understand the Wild Card behavior in the Firebase Rules and must ask, Will this Firebase Rules json work when it comes to the Wilde card as root, (down below is the Firebase data json as a ref) { "rules": { …
Tord Larsen
  • 2,670
  • 8
  • 33
  • 76
1
vote
2 answers

Android - application crashes when trying to add item to database

I am totally new to developing Android applications and I do not understand why my app crashes. Here's the code: public class ProductListActivity extends ListActivity { private ProductDataSource datasource; private ListView lv; private…
1
vote
1 answer

How do I display the right rows from the random row list selected from the Database in Android Studio?

I am making a quiz section in my Android App. I made a Database, and made it so the program selects random rows (questions) from the table. These random questions are then displayed in the actual quiz after which the user can see which questions he…
1
vote
1 answer

When I search for data, my app forced to stop. How can I solve this?

When I search for data in my database, my app forced to stop. It is only happening when there are more than 2 rows, otherwise it's fine. I can insert data well. How can I solve this? //click event public void OnButtonClick(View v) { …
Aadhi
  • 15
  • 8
1
vote
2 answers

Android SQLite ForeignKey Column not found in Database

After the program runs Successfully and i extract .db file from Android Device monitor,I can find all my Tables and columns for each tables except the Column for Foreign key.Can anyone why this is happening? Is there something wrong with my Query?…
1
vote
1 answer

Realm Array of Strings in Android

I have been trying to store an array of strings in Realm database programmatically as given below: Model Class: public class Station extends RealmObject { private String name; // ... Generated getters and setters ... } Saving Data: …
V1 Kr
  • 177
  • 1
  • 3
  • 18
1
vote
3 answers

Save generic object in database

My model is like: public class MyModel{ private String mId; private String mName; T mAnObject; } How can I store T object in database.
Charu
  • 1,055
  • 13
  • 18