Questions tagged [android-sqlite]

Android uses SQLite to store and retrieve data persistently. Use this tag for questions regarding the Android implementation of SQLite, how to use it in your application, or for help when your implementation of SQLite doesn't work.

uses a SQLite database to store and retrieve data persistantly.

Every Android App gets a private SQLite database to persistantly store data.

See also

8244 questions
11
votes
1 answer

GROUP BY clause to get comma-separated values in sqlite

My table structure is like this, using sqlite3 CREATE TABLE enghindi (eng TEXT,hindi TEXT) i have an table named enghindi in that there is two column named hindi, eng, i want to merge eng column's record and also combine hindi word by…
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150
11
votes
4 answers

Is the semicolon necessary in SQL?

Sometimes it works anyway if I forget the ;. But sometimes it doesn't. And in JDBC and Android SQLite, it seems that I don't need ; at all. I am confused. When should I use a semicolon?
nomnom
  • 1,560
  • 5
  • 17
  • 31
11
votes
2 answers

syntax error with FOREIGN KEY in CREATE TABLE

I am getting following output on debugger. I am not sure what syntax is missing. The SQL code is: CREATE TABLE weeks(Week_Id INTEGER PRIMARY KEY, Day TEXT, Start_Time Text, End_Time Text, Break_Time Text ); CREATE TABLE…
Coder
  • 3,090
  • 8
  • 49
  • 85
11
votes
7 answers

How to properly close a cursor in android

I have this database using sqlite, and I'm having problem with closing the cursor its saying that Application did not close the cursor or database object that was opened here here's the logcat 10-18 08:40:56.354: E/Cursor(331):…
philip
  • 1,292
  • 3
  • 24
  • 44
11
votes
1 answer

How to improve performance for SQLite database for android

There are few questions related to this topic on stackoverflow, But I didn't get the proper answer. I have some doubts on performance of flat files, Is it better to use flat files instead of SQLite ? I took performance statistics for Android…
sam_k
  • 5,983
  • 14
  • 76
  • 110
10
votes
2 answers

SQLite count number of occurence of word in a string

I want to count number of occurrences of a word in a string for example…
Krishna
  • 143
  • 2
  • 10
10
votes
2 answers

Android App Crashes on Startup: SQLite NullPointerException in ContactsFragment

I'm working on integrating a database to save and store basic contact information to be retrieved at a later time. However, my app is now crashing on startup so I cannot even verify if the table is being created, etc. 05-05 16:39:50.671 …
10
votes
3 answers

How to develop an offline-first native Android app

We are developing a native Android app (iOS and web to follow) where users can collaboratively create an album. We want as seamless as possible experience when device is not able to connect with server. Something like mentioned in this Hoodie blog…
Sangharsh
  • 2,999
  • 2
  • 15
  • 27
10
votes
4 answers

Maximum SQLite Database Size in Android Application

I am new to the Android Development. Currently, I am working on one Android Application having a large amount of data. So I have thought that I should have to store some of those data locally. I have one database having 2 tables. Table-1's size is:…
Manali Sheth
  • 379
  • 2
  • 5
  • 17
10
votes
2 answers

GreenDao freemaker.jar is missing

I just downloaded the new jar file for GreenDao in order to create my DB for the app I'm building. After going through all the process of modeling my entities and the connections between them, I tried to run the generator project but got this error…
thepoosh
  • 12,497
  • 15
  • 73
  • 132
10
votes
1 answer

How to set timer to call a function every n minutes?

I want to set up a timer in an Android application that will call a function after every 15/30/45 and n minutes when user login. But also it will stop timer when user log off. and timer begin from start if user login again. I want that…
Shweta
  • 1,145
  • 5
  • 18
  • 35
10
votes
5 answers

Android Pushing Updates on Play Store

I have an app that depends on SQLite for data which is populated by xmls shipped with the app in the assets folder. When you run the app the first time it sets a shared preference config_run = false. then i check if config_run = false then parse…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
10
votes
4 answers

Save data in activity's onDestroy method

I'm writing a tasklist and have Project object, which holds all the tasks (and metadata). I use action log, so when tasks changes i do not save it immediately to database, just keep it in memory to dump in database on activity finish. Activity's…
ryabenko-pro
  • 728
  • 1
  • 7
  • 18
10
votes
1 answer

SQLiteException "cannot commit - no transaction is active" while inserting with CONFLICT_REPLACE

I have some trouble updating my database. This is the log: 12-02 16:18:57.502: D/Data Update(21218): Start updating databases 12-02 16:18:57.502: D/Data Update(21218): update size: 5 12-02 16:18:57.502: D/Data Update(21218): updating table…
mmaag
  • 1,534
  • 2
  • 18
  • 24
10
votes
3 answers

problems in creating multiple tables in sqlite

I'm using the following code for creating multiple tables in a database. But, I don't understand why this problem happens. private static final String TABLE_SMSFilter = "SMSFilter"; public void onCreate(SQLiteDatabase db) { …
Ahmad Abbasi
  • 1,776
  • 6
  • 29
  • 43