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

Android Room + Window Functions

I try to use a Window Functions in a Room Query. The parser is complaining about my query. I simply try to add a "ROW_NUMBER() OVER (ORDER BY column)" expression in my select statement. Without this expression, the query is running correctly. Parser…
Jerome Dupont
  • 203
  • 2
  • 7
8
votes
1 answer

How to check whether record is delete or not in ROOM Database?

Using SQLite DB, db.delete will return a long value that is the row ID of new row, or -1 if an error occurred. So you can check it to know delete is successful or not by : int result = db.delete(TABLE_NAME, COLUMN_ID + " = ?", new…
Rajesh Satvara
  • 3,842
  • 2
  • 30
  • 50
8
votes
3 answers

Reopen ROOM database

I'm trying to close and then reopen Room database. (The purpose is to backup SQLite file) This is how I close it: public static void destroyInstance() { if (INSTANCE != null && INSTANCE.isOpen()) { INSTANCE.close(); } INSTANCE =…
Alex Busuioc
  • 992
  • 1
  • 11
  • 24
8
votes
1 answer

Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider when RESTARTING the app

I have an Android application that allows users to choose a photo for their profile as follows: public void pickImage(View view) { Intent getIntent = new Intent(Intent.ACTION_GET_CONTENT); getIntent.setType("image/*"); Intent pickIntent…
8
votes
4 answers

Android- setPeriodic for JobScheduler won't work

I've wrote an app for creating and reminding task which uses local SqliteDatabase. I wrote a jobScheduler service to check the device time and date with tasks on the database and if matches shows a push notification. What I want also is service to…
Hadis
  • 535
  • 3
  • 11
  • 31
8
votes
1 answer

Android with Room - How to set a foreign key nullable

I'm using Room in my Android app. One table (stock_move) contains several Foreign keys. In some case, I need to insert a stock_move without a FK (locationDestId). In this case, SQLite raise an…
sylvainvh
  • 111
  • 2
  • 5
8
votes
1 answer

How to store and retrieve a byte array (image data) to and from a SQLite database?

How do I store and retrieve a byte array (image data) to and from a SQLite database in Android?
Alex
  • 16,375
  • 7
  • 22
  • 19
8
votes
1 answer

Store new position of RecyclerView items in SQLite after being dragged and dropped

I have a two dimensional ArrayList of type String which is the input to the adapter class of the RecyclerView. The data in the list is taken from an SQLite database everytime when onResume() is called. I have implemented a drag and drop feature and…
Marat
  • 6,142
  • 6
  • 39
  • 67
8
votes
3 answers

SQLiteFullException: database or disk is full (code 13) GreenDao

how to solving SQLiteFulException in greenDao when I delete record from table? this is my stacktrace : android.database.sqlite.SQLiteFullException: database or disk is full (code 13) at android.database.sqlite.SQLiteConnection.nativeExecute(Native…
Gigin Ginanjar
  • 151
  • 1
  • 2
  • 12
8
votes
1 answer

How to store the audio/Video file to SQLite database in android.?

Am new to developing, am successfully store the images to database by converting the images in to bytes array and store it to SQLite database in BLOB (find below code). But am not getting how to store audio's/video's into DB any one help me PLZ... …
8
votes
3 answers

Android SQLite alternatives

I'm building a simple android RPG. Each player has access to a maximum of about 50 soldiers. Each soldier has some stats (class, hp, attack, etc), and three inventory slots. There will be only about 100 items in the game to fill these inventory…
Jake Marzen
  • 125
  • 1
  • 1
  • 6
8
votes
4 answers

How to store datetime in SQLite

This is very similar to another question that got closed as not a real question. I tried to edit it to make it valid for reopening but was told I would be better off asking a new question. I'm developing on android and need to store datetime values…
Matthew
  • 6,351
  • 8
  • 40
  • 53
8
votes
3 answers

How to use regexp in sqlite

Please prompt, how used REGEXP in SQLite? Realization: SELECT field FROM table WHERE field REGEXP '123' It is not working. Error: no such function: REGEXP
user1854307
  • 580
  • 4
  • 8
  • 21
8
votes
2 answers

How to manage free and paid versions of an Android project?

I decided to build a paid version of my free Android application. The paid version has some extra features. How do I manage both versions? Is it possible to keep them based on the same source code? If an application requires unique package name,…
x2bool
  • 2,766
  • 5
  • 26
  • 33
8
votes
1 answer

What is the difference between REFERENCES with, or without a FOREIGN KEY

In regards to SQLite, What is the difference between REFERENCES with, or without a FOREIGN KEY? What is the difference between this CREATE TABLE players_set ( _id INTEGER PRIMARY KEY AUTOINCREMENT NOT…
Konrad Morawski
  • 8,307
  • 7
  • 53
  • 91