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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

Android Studio Java if statement with sqlitedatabase

I checked the code for red lines and red text, but there were none. Through app inspection, I confirmed that the value test111 was correctly entered into AAAA1 in the database, and that the value ...
akkbar's user avatar
  • 1
0 votes
1 answer
25 views

How to add column of List<String> and List<Object> to the Room Database?

I am trying to add two more columns to my existing room database: execSQL("ALTER TABLE table ADD COLUMN cars List<Car>") // -> var cars: List<Car> = listOf() execSQL("...
Mark Delphi's user avatar
  • 1,402
1 vote
1 answer
33 views

How do I perform the Android Room Database migration by changing existing data types?

I use the Room Database in my Android app that provides a table of Car as follows: @Entity(tableName = "Cars") data class Car( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "...
Mark Delphi's user avatar
  • 1,402
0 votes
1 answer
25 views

I can't update the data about an item in the database

I'm new to android development, please help. I have a RecyclerView – it has a list of items opposite each of which there is an opportunity to add it to favorites. When clicking on the ImageButton, the ...
Денис Белозёров's user avatar
1 vote
2 answers
39 views

Android Studio SQLite error: Incorrect column ("no such column: _id")

I have set up a SQLite db in an Android app but to focus on the immeidate problem will only reference the Users table. In DatabaseContract the Users table is defined as: public final class ...
kiteandwindsurfer's user avatar
0 votes
0 answers
30 views

recycler view shows the data twice and when i go back and reopen the chat activity it show the correct data

I am creating a chat application using SQL database. When i am sending data the data showing many times in recyclerview and showing worng data but when i am going back and reopen the chat activity it ...
mm m's user avatar
  • 59
0 votes
1 answer
31 views

FLUTTER - How do I update a database from a synchronous function in Dart/Flutter?

I am trying to implement a database into my first ever Flutter app (a calendar app), and wanted to store some DateTime values in a SQFlite database. Since all CRUD operations are asynchronous, I ...
Nandan Praveen's user avatar
0 votes
1 answer
37 views

Flutter SQFlite - type bool is not a subtype of type int in type cast

I am a complete flutter and sqflite beginner. I am trying to make my calendar events persist over app restarts so I am implementing an SQFlite database. However, I keep running into this error and ...
Nandan Praveen's user avatar
0 votes
2 answers
53 views

id is always returning 0 in Android Studio SQLite. Help me point out the problem

I'm creating a todo list app with Android Studio. My MainActivity.java package com.example.myapplication; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import ...
Jason's user avatar
  • 11
0 votes
0 answers
41 views

Database query returns an empty value

I make a query to the database and it gives an empty value, although there are at least two values in it (added via SQLite) import 'package:connectify_app/model.dart'; import 'package:path_provider/...
Denis's user avatar
  • 1
0 votes
1 answer
23 views

How to protect the SQLite database in the Android studio app before publishing?

I've been working on an Android App using a sensitive data stored in an external SQLite database in the Assets directory. I edit it externally and put it back to the project. I don't want to leave it ...
Ahmed EL_Telbani's user avatar
0 votes
1 answer
23 views

Problems with database initialisation

I'm making an app on flutter. I connect the database to the application and, when registering, I compare the username list with the input data and if they match, I should get an error. The problem is ...
Denis's user avatar
  • 1
1 vote
1 answer
29 views

Android Stuido sqlite database no such table error

I'm trying to use sq lite database in android studio, but I get no such table error I created an sqlite database and I was waiting for the database I created to assign data to the recycler view and ...
Yasin G.'s user avatar
0 votes
0 answers
27 views

react native sqlite storage load custom extensions

I have created an extension for sqlite database that i want to use in my react native app. where should i place it in android directory and what is the path to it in the sqlite command? i am using ...
mohammad javad's user avatar
0 votes
0 answers
25 views

Issue With SQL Insert From CSV

I have an issue with my code funcitonallity. Im trying to get android studio kotlin code to scan each CSV file row and check if the cooridantaes in the row match the current user coordinates. If so, ...
SaferWayz's user avatar
0 votes
1 answer
40 views

using relationship and inheritance in roomdatabase

I'm trying to create a simple e-wallet app and I want to save the details of each change of the account balance along with the current balance right after any transaction. I want to save these ...
DAT Vu's user avatar
  • 1
0 votes
2 answers
84 views

"tx.executeSql" Not Working Properly In Expo-sqlite-storage

I am adding a feature to my app that allows users to include recurring expenses. I am storing this information in a table, which is created using the following code: // Creating or opening a table to ...
jay shah's user avatar
0 votes
1 answer
32 views

Room Migration Error - NO SUCH COLUMN EXISTS

I have written a room migration code which crashes due to the following error: This is the error that I'm getting : no such column: LocationID (code 1): , while compiling: CREATE TABLE IF NOT EXISTS ...
Abhijith Warrier's user avatar
-2 votes
1 answer
36 views

Do we need to use a synchronized block for Room database [closed]

I have some code that I would like to use something like a threadpool because I am making multiple transactions at once. I used to use a SQLite database with a synchronized block. I figure that Room ...
user1743524's user avatar
-8 votes
1 answer
69 views

Data failed to insert in database

I am facing trouble while inserting data in database. The table was created but data was not inserting dbhelpher class func mainactivity onlick func I have tried to insert data on databse using ...
sufyan ashraf's user avatar
0 votes
0 answers
27 views

I need to get the data stored to my sqlite data.db file and displayed in the table

I got this code from Youtube, it's very useful, but the data is being stored in a websql database, and I would like it to be stored instead in a database file called data.db located in my data folder. ...
Leg3nd4ry's user avatar
-1 votes
1 answer
100 views

EXPO SQLite, ReferenceError: Property 'db' doesn't exist, js engine: hermes

I am trying to open a database called expenses.db but I am getting the error, ReferenceError: Property 'db' doesn't exist, js engine: hermes This is the code I have written, import { View, Text, ...
jay shah's user avatar
0 votes
1 answer
331 views

How to use Sqlite with expo in React Native?

Does 'react-native-sqlite-storage' work with expo or it is compulsory to use expo-sqlite. I am trying to create an app which heavily depends on a database but for some reason 'react-native-sqlite-...
jay shah's user avatar
0 votes
1 answer
37 views

How to get the score of a certain player in my sqlite database

I have a table with the following columns: id, PlayerName, PlayerScore with the rows of 1, Ahmad, 100 2, Sara, 100 3, Mohammad, 100 and a recylcerview that contains name and score only, I want to ...
Haitham Shalabi's user avatar
-2 votes
1 answer
68 views

Boolean always convert to zero in Android

I'm using Android Studio Chipmunk 2021.2.1 Patch 1 Android Studio Chipmunk | 2021.2.1 Patch 1 Target SDK 31, Min SDK 23 I'm importing data from a web service that looks like this: I added the last ...
Kim HJ's user avatar
  • 1,183
0 votes
1 answer
74 views

Display multiple records from sqlite bank

I have a dictionary database ready, I want to use it in Xamarin Android. I wrote some codes. But I could not display the search results in the list view, please help me. It is displayed in the text ...
Moein Moeini's user avatar
0 votes
0 answers
17 views

Image malformed downloading from FTP

I have an app where I download a sqlite database from FTP. The file works fine, if I upload into the tablet to the data folder works fine, but if I download with FtpClient as soon as I try to ...
PAR's user avatar
  • 13
0 votes
0 answers
37 views

Saving positions to database after drag and drop on RecyclerView element

Drag and drop of elements is organized in RecyclerView. The data is retrieved from an SQLite database. Everything works! The problem is saving new positions to the database. Can only move the first ...
Юрий Берека's user avatar
0 votes
1 answer
40 views

Instantiating class inside a ViewModel

This app creates a greeting card. Flow is select a photo on fragment #1, a contact on fragment #2, enter a message on fragment #3 and review, confirm and send on fragment #4. The data for this app is ...
stroopwafel's user avatar
0 votes
1 answer
28 views

Android Room invalid schema only on Lollipop 5.1 SDK 22 with duplicated primaryKeyPosition

I have the following Entity: @Entity(tableName = "game_regions", primaryKeys = {"_game", "_region_area"}, foreignKeys = { @ForeignKey( ...
Nexussim Lements's user avatar
1 vote
0 answers
24 views

Load ICU Extension on Android sqlite to resolve LIKE lowercase issue

I have an Android app that is also used by Greek users, but I'm having an issue with some queries I'm making. Essentially, the "like" functionality only works if I write Greek letters in ...
aeroxr1's user avatar
  • 1,014
1 vote
0 answers
61 views

Save SQLITE database in download folder and use database

I save my database in the folder /storage/emulated/0/Download/Database. Initially, the database functions properly. However, when I uninstall and then reinstall the application, I encounter an error ...
VDTe's user avatar
  • 438
1 vote
1 answer
49 views

SQLite Kotlin issue - no database

I am trying to create boardgamegeek APIs based app in AndroidStudio, however from unknown reason I'm getting my database created with no columns. Here's Logical log: (1) no such table: games in "...
Tom 300's user avatar
  • 15
0 votes
1 answer
78 views

Insert in SQLite faster using single Android Room transaction rather than multi transactions

By default, each method annotated with @Insert, @Update, or @Delete in DAO class will be executed within its own transaction and additional transactions are queued and executed on a first come, first ...
oguzata's user avatar
  • 33
0 votes
1 answer
51 views

How can I retrieve the longest string from a specific SQLite column in Android Studio using Java?

I am trying to get the longest string from a column in an sqlite db. Cursor c = db.getLongest(); String c1 = c.getString(0); String c2 = c.getString(1); Log.v("...
user3096763's user avatar
0 votes
1 answer
83 views

How to Upsert item with unique index in Android Room?

I have JSON data in an API host like this "product": { "barcode": "2489752310342", "productName": "Trench coat", "priceList&...
oguzata's user avatar
  • 33
2 votes
0 answers
177 views

Android Room - DAO method returning Flow emits data only once for a composed object

I have two tables, Location and Weather. They have one-to-one relationship. Weather has a foreign key that keeps the id of corresponding entry in Location. @Entity(tableName = "location") ...
Mehmed's user avatar
  • 2,900
-2 votes
1 answer
42 views

SQLITE 522 SQLITE IOERR SHORT READ

I got this error every time. How can I solve this issue. I got this error Honeywell EDA51K device. android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 522 SQLITE_IOERR_SHORT_READ) Am ...
Vinoth M's user avatar
-4 votes
1 answer
239 views

UNIQUE constraint failed: products.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)) sql 'INSERT INTO products (id, name, price, quantity) VALUES (?, ?, ?,

I get eroor SqfliteDatabaseException (DatabaseException(UNIQUE constraint failed: products.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)) sql 'INSERT INTO products (id, name, price, quantity) VALUES (?,...
Riko Permana's user avatar
-1 votes
2 answers
125 views

How to set maximum size of Room database

I'm trying to set the maximum size of Room database. I found that I can set maximumSize in database onCreate() callback, but then when I'm checking this value in onOpen() callback it is not changed. ...
pmw_14's user avatar
  • 9
1 vote
1 answer
38 views

How can I add the sencond sort item when I use CASE to require parameter for SQLite with Room in Android Studio?

I have read the article The Code A can work well in Android Studio. At present, I hope to sort records by starred desc first, then by createdDate desc, so I replace Code A with Code B. The Code B can ...
HelloCW's user avatar
  • 1,063
1 vote
1 answer
44 views

Integrating SQLCipher latest version v4.5.4 with android kotlin project

I could find a lot of integration samples for old versions of SQLCipher with android and it also works. But I need to integrate latest version of SQLCipher like v4.5.4 because it mentioned that that ...
Dhana_prakash's user avatar
0 votes
1 answer
67 views

Will SQLite database be locked when some suspend function to operate it in Android?

I use SQLite with Room in my Android Studio project. There are some suspend functions to operate a SQLite database, some suspend functions in background service to modify records. Will the SQLite ...
HelloCW's user avatar
  • 1,063
0 votes
0 answers
38 views

Can't perform crud operation on API data stored in SQLite DB Flutter

I am learning Flutter and have recently worked with JSON placeholder APIs and performed CRUD operations. But now I am trying to store the API data in local DB SQLite and perform CRUD operations in ...
Abdullah Al Fahad's user avatar
0 votes
1 answer
42 views

error Unsupported operation: read-only.how remove items from list if I use sqlite flutter and show the names in future builder

this code show me the names of Sqlite database before begin the game I want to add the players names from database to can save the records so I use check box to select the team1 players and save the ...
Yous y's user avatar
  • 45
0 votes
1 answer
207 views

Save Image URL to SQLite database as blob

I'm stuck with this issue for a few days now. I made a React native app, that retrieved all restaurant dishes and images from a server. Now my customer wants me to add an offline mode to it. My idea ...
David's user avatar
  • 1
0 votes
1 answer
23 views

Storage with sqlite in fragment [closed]

I wrote a program that reads a data from editText and then saves it I ran this program once in activity and it worked correctly but on fragment it gives error please help me my fragment public class ...
amir mohammad's user avatar
0 votes
1 answer
99 views

Room / SQLite query with min(...) without returning any result if nothing found

Currently stuck at a SQL roadblock and I am having no luck in finding any answers for my issue due to how generic the relating words are. I have two queries that appear to be the exact same thing, but ...
Shadow's user avatar
  • 4,202
2 votes
1 answer
202 views

Room create from asset + fallbackToDestructiveMigration recreating the database on each request

Using Room, I load my database from assets (an already populated database). I do plan to update the database content very often, so every time the version is increased, the old database the user has ...
Nexussim Lements's user avatar
0 votes
0 answers
26 views

Backup and restore the local database

while using append mode the running process is completed but the data can't display, using append mode only Backup method public void backup(String outFileName, boolean appendMode) { try { ...
THANIGAIVEL R's user avatar

1
2 3 4 5
165