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
0
votes
1 answer

storage of android app data so that data couldnot be erased

if we store data in sqllite database in android, then data will get erased if this apk is installed in another phone. Then how does offline dictionary apps store data which is accessed by everyone having the app.
ANURAG GUPTA
  • 173
  • 1
  • 13
0
votes
1 answer

Inconsistent results on Android SQLite query

I'm experiencing some unexpected inconsistencies on the result of a SQL query on Android. Given the following Schema (which is pretty simple): public static final String TABLE_TOTD = "totd"; public static final String COLUMN_ID = "id"; public static…
Henpemaz
  • 13
  • 4
0
votes
0 answers

SQLiteDatabase and Cursor leaks and close() calls

I need some help on database and cursor managing. I noticed that, when entering /leaving certain fragments, I get: W/SQLiteConnectionPool﹕ A SQLiteConnection object for database '+data+data+database' was leaked! Please fix your application to end…
natario
  • 24,954
  • 17
  • 88
  • 158
0
votes
1 answer

Access the existing database in new application

I have already created android application(app 1) that takes creates database and stores data.Now i have created another android application(app 2) which requires access to the database created previously(in app1). How can I access to database in…
Vinit Khanna
  • 81
  • 1
  • 1
  • 10
0
votes
3 answers

Add object to DB in one fragment and update listView in another

I have an activity with 3 fragments and I need to update fragExchangeHistory listView from DB when I add an object to database in fragCurrencyExchange. How could I do it? Code: GitHub
Roo
  • 613
  • 1
  • 7
  • 24
0
votes
1 answer

Select fields empty sqlite table

I have a sqlite table. The point is that I want to select all rows where table field "name" is empty. In applying the code gives me error and I cannot fix. The following code: ArrayList smsContact = new ArrayList(); String…
user3068256
  • 61
  • 1
  • 5
0
votes
4 answers

Inserting huge number of data into sqlite database

i am following this link using database but it uses "ContentValues" to insert data into database ContentValues values = new ContentValues(); values.put(KEY_NAME, contact.getName()); // Contact Name values.put(KEY_PH_NO, contact.getPhoneNumber());…
Keshri_raj
  • 81
  • 1
  • 8
0
votes
1 answer

Fatal exception when reading data from cursor from SQLite

In AsyncTask I read database table (one-by-one) like this: Cursor result = database.query("country", new String[] { "_id", "name", "var1", "var2", "var3", "var4", "rightanswer", "time1", "time2", "time3" }, "_id=" + id, null, null, null,…
JohnDow
  • 1,242
  • 4
  • 22
  • 40
-1
votes
2 answers

Which Android database solutions are best for working with both online and offline-only users?

I plan to make a meditation journal app which stores all the user's data offline on the user's device, but also offers an option to sync this data to the cloud. Firebase isn't really a good solution for this as it generally expects that the device…
Adam
  • 2,167
  • 5
  • 19
  • 33
-1
votes
1 answer

Android database does not create columns in the table

I have a database with two tables that I want to work with. I have no problem with the first table, but when I have a database with two tables that I want, I have no problem when working with the first table, but when I insert the data in the second…
rani
  • 1
  • 2
-1
votes
1 answer

Prevent repetitive value from being inserted into database android

Here is my code: final String[] names_list = { "apple", "banana", "orange" }; final int[] preview_list = { "R.drawable.apple", "R.drawable.banana", "R.drawable.orange" }; final int[] colors_list = { "red", "yellow", "orange" }; int…
Abolfazl SM
  • 39
  • 1
  • 7
-1
votes
1 answer

How to store images and some text in android app

I'm about to make an android app something like "fun places to visit in my city" where u can see photos and description of the place. I thought something like store all images in drawable folder, and create list of data class. But the app will be…
-1
votes
2 answers

How to avoid duplicate rows in SQLite database in Android?

I am stuck at how do I avoid duplicate rows in Sqlite Database.I tried every possible answer on StackOverflow but none of them worked for me.I tried using unique constraint, db.insertWithOnConflict() but both of them was of no use. Can anyone please…
Knowledge hub
  • 51
  • 1
  • 8
-1
votes
1 answer

In Android DataBase i Got This Error: android.database.sqlite.SQLiteException: near "+": syntax error (code 1)

Hello I Got This Error: android.database.sqlite.SQLiteException: near "+" syntax error (code 1) , while compiling: SELECT * FROM tbl_Individual_Donor_Registration WHERE BloodGroup = B+ Here Is My Code For Table Elements: public static final int…
t Patel
  • 1
  • 1
-1
votes
1 answer

Check Database Table exists or not via Content provider in Android

As ContentProviders can use internally database,Is there anyway to check particular table exists or not using content provider URI. Any related links/code helps me a lot. Thanks in Advance.