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.
8,106
questions
0
votes
0
answers
14
views
How to login with offline mode when a valid user login online
I am developing an app. My goal is that user can login online and offline both, but for the offline mode user should login online enters their credentials (userid and password) and save the user's ...
0
votes
0
answers
16
views
Offline login only when a valid user login online
I am developing an app. My goal is that user can login online and offline both, but for the first time user should login online enters their credentials (userid and password) and save the user's ...
0
votes
1
answer
14
views
What are the options to store GTFS Data for Android App
I am learning android developement in Java. As part of my learning I have started a project working on Transit App using GTFS data.
I have got two concerns:
data File Size:
My sqlite db file size has ...
0
votes
0
answers
17
views
SQlite (Room) Trigger: three queries
I have the following trigger:
database.execSQL(
"CREATE TRIGGER IF NOT EXISTS update_item1" +
" BEFORE UPDATE" +
" ON ...
-1
votes
2
answers
26
views
Android SQLite same DB [duplicate]
I am using local DB (SQLite) with my android app. I know, that with every first launch of the app, a new database is created. Is there an easy and quick way to fetch the new database with my prepared ...
0
votes
1
answer
33
views
How to remove ALL data from the database
I would like to remove ALL data from the database (with auto-increment values).
I use Room.
I have read in the documentation there is something like clearAllTables() but according to the documentation:...
1
vote
1
answer
41
views
'.', <column alias name>, <compound operator>, AS, BETWEEN, FROM, GROUP, IN, LIMIT, ORDER, WHERE, comma or semicolon expected, got 'SELECT'
Please I need help fixing the error above _ in the title _ appeared in the first SELECT after FROM of this query, all suggestions are welcome so thank you very much.
public ArrayList<HashMap&...
1
vote
0
answers
25
views
How do I insert initial data in a SQLite Database table?
I'm currently trying to create an Flashcard application, in which the user can either create his own cards/notes or use pre-defined cards. The idea is to have around 500 to 1000 cards to be inserted ...
1
vote
1
answer
42
views
App crashes when i and ranking to my query string
"SELECT * FROM " + STUDENT_TABLES;
this code works but i want to have ranking column so i added updated it to this
String queryString = "SELECT *,RANK () OVER" + "( " +...
-1
votes
0
answers
25
views
Getting students class position from list of total scores from sqlite database table [duplicate]
I have this table of students
public void onCreate(SQLiteDatabase db) {
String createTableStatement= "CREATE TABLE " + STUDENT_TABLES + " (" + ID_COL + " INTEGER ...
1
vote
1
answer
22
views
Android and SQLite: "nested" getReadableDatabase
In my Android app I use the following code to access db:
public class DbHelper extends SQLiteOpenHelper {
/* ... */
}
public class DbManager {
private DbHelper helper = null;
public ...
0
votes
1
answer
50
views
onUpgrade is not getting called in SQLiteOpenHelper
The method onUpgrade is not getting called even if it gets the DB version greater than the current.
I verified the DB version using the following command and it is 6 currently.
sqlite> PRAGMA ...
0
votes
1
answer
32
views
Can not update the data of SQLite database in Android
I try to update my data in the SQLite database but when I do db.update the ide through an error and convince me to create a local var for it
public void updateEmployee(int sno, String name, double ...
0
votes
0
answers
25
views
Items get deleted from ListView but not from SQLite database
I have seen similar question but mine is bit different.
I have CustomListAdapter with delete button
image here
Issue is once I click this delete button Item gets deleted from ListView but not from ...
0
votes
0
answers
20
views
transformDexArchiveWithExternalLibsDexMergerForRelease Failed
I am using sqlcipher for database security. In debug mode signed apk generated successfully.But release mode getting Error, I have tried with adding multiDexEnabled in gradle, cleaning .idea and ....
-1
votes
1
answer
55
views
How to fix/implement Search Filter with RecyclerView
I followed the same youtube tutorial (https://www.youtube.com/watch?v=VQKq9RHMS_0&ab_channel=Stevdza-San) and read the answer/feedback from this user's question (How to implement Search Filter ...
0
votes
1
answer
50
views
SQL no such table But table exists
I made a database file in python using sqlite3. The database holds 2 tables ANSWERS,QUESTIONS. I want to use that file in my android app and i followed this post to copy it instead of creating it. I ...
0
votes
0
answers
50
views
How do I get user input from EditText that is in a dynamic cardview?
I have a horizontal card (view) that is added on add button click. Added card contains one textview with a number that is auto incremented and displayed. Then the issue is, I have two EditTexts for ...
0
votes
0
answers
19
views
How to store a non-serializable class' object in Room Database?
I am working in Pose Estimation library from Google ML Kit
The lib storing the retrieved poses in a class Pose which contains a array of PoseLandmark class
Now I need to store the Pose class in the ...
0
votes
0
answers
17
views
Assign sqlite query result to Flutter variable
My app requires employees to scan an NFC tag to clock in and out for work. What I want to achieve is to prevent duplicate entries - i.e. before an someone can clock in again, they have to be clocked ...
0
votes
0
answers
20
views
Android sqlite update statement with from does not work
I am trying to create a trigger like below in sqlite android. It works fine in other sqlite engine but shows syntax error in android. Please help me to make this update statement work.
create trigger ...
0
votes
0
answers
21
views
Content URI TO Android Room (SQLite conversion)
I am given a task where I need to change the activity. The Activity uses Cursor Loaders, Cursor and Content Uri.
Uri tempUri = some function call; That calls // BASE_CONTENT_URI.buildUpon().appendPath(...
0
votes
1
answer
35
views
How to see created database and table android studio flutter
I have created a database in flutter using SQFLite. I have created a table and inserted some values in it. I wanna see all those data and tables how to do that I am using android studio.
1
vote
0
answers
16
views
Quick livesearch on 1M strings in React native
I have around 1M strings, new strings may be added or deleted once every month. And my goal is to perform fastest possible live search in those string, in react native. I will discuss about the ...
0
votes
1
answer
51
views
Stored data not appearing in GridView
GridVIew
I have implemented grid view in my application but it’s showing nothing although it’s not giving any error.
In xml layout I also couldn’t see the grid view.
Adapter
public class ...
-3
votes
1
answer
34
views
How to protect my SQLite db by intentionally corrupting it, then fix it through code?
This is my first app on Android with Java and SQLite.
ISSUE:
I have a local SQLIte db on my app. I was very surprised to see how easy it is to get access to the db once you have installed the app (no ...
1
vote
1
answer
27
views
How to get row cursor with primary key android
I have a table with the following
@Override
public void onCreate(SQLiteDatabase database) {
database.execSQL( "CREATE TABLE " + TABLE_NAME + " (" + "ID" + " ...
-1
votes
1
answer
20
views
using or case in Query with sqlite
i need to search with 2 varibiles name , phone
and with spcific stat for the two cases
like :
case 1
spcific name with it's stat
case 2
spcific phone with it's stat
which right method to do this
...
3
votes
0
answers
61
views
Whats cause of duplicate column name run_in_foreground while compiling ALTER TABLE workspec ADD COLUMN run_in_foreground INTEGER NOT NULL DEFAULT 0
do not have idea why I am getting this crash for some user whose device is in background, that error might be coming because of the workmanager library so I am not able fix that ,Can anyone help here ...
-1
votes
1
answer
23
views
Force Close when Adding and Showing data from internal database SQLite Android [closed]
This is my MainActivity Class
public class MainActivity extends AppCompatActivity {
TextView textView;
String text;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
0
votes
1
answer
36
views
Sqlite sync and async together
Is it good practice to use sqlite sync and async together.
Example i need on create method to use sqlite sync but in other thread to update another table async.
public class DatabaseHelper
{
...
0
votes
1
answer
24
views
Android Studio: ContentValues vs Database.execSQL()
My question can be considered as a continuation of What is the difference between inserting data using ContentValues and Raw SQL in SQLite Android?
My question is more towards: Which is more common ...
0
votes
0
answers
18
views
Android Studio stopped recognising SQLite database without me changing any code or updating database
I've been working on a language learning app for a university project which needs to take vocabulary from an SQLite database.
This was previously working fine, but now it gives me an ...
-1
votes
1
answer
20
views
Can I access any records in SQLite database without using the cursor?
I've tried by searching for lots of examples in order to understand how SQLite database in Android Studio. I recently started by reading the basic manuals since no simple usable examples can be found ...
-2
votes
1
answer
34
views
How to write a SQLite query for android room database
What my User class looks like
@Parcelize
@Entity(tableName = "user_table")
data class User(
@PrimaryKey(autoGenerate = true)
val id: Int,
var name: String,
...
0
votes
0
answers
22
views
deleting Blob from SQLiteCipher db
I am storing images in SQLiteCipher as a blob (byte[] form):
public void insertNewImageBlob (byte[] image, String password) {
System.out.println(image);
SQLiteDatabase db = ...
0
votes
1
answer
48
views
Unknown error calling sqlite3_step (11: database disk image is malformed) eu : iOS
I am working on an iOS App, using SQLite DB. The app has a functionality where on opening the app, records from the server are inserted into the local SQLite db. During this process, my SQLite DB is ...
1
vote
1
answer
34
views
Delete using inner join with composite primary key
I am trying to delete some records from my database, I have succeeded and it works when testing in "DB Browser for SQLite" software but when I try to copy it to my Android Studio project I ...
-1
votes
1
answer
43
views
Possible to store time in SQLite database?
QUESTION: Im making a flashcard app and when the user clicks "easy" for example, I want to increase the time of the card, then that card won't appear until the time goes reaches 0.
e.g. &...
1
vote
1
answer
32
views
Flutter with SQLite - constraint violation in transaction leads to error in following transaction
I use Flutter with the sqflite package.
I execute a query that violates a FOREIGN KEY constraint, inside a transaction.
I catch the exception, and then try to start another transaction. This fails ...
0
votes
0
answers
14
views
expo.sqlite high memory usage when creating to many transactions at a close interval
I am using expo-sqlite for my application and encounter an odd problem.
I have a ``ScrollViewand I want to save the scroll position too the db and so I am doing it inonScrollEndDrag`
The issue is that ...
1
vote
1
answer
52
views
Android sqlite update not updating as expected, double-quoted string literal or no such column Errors occur
I pass the correct data through to the db modifier function, set the values in the ContentValues, but can not seem to get it to update. I am trying to update by name (a PK) which is of type string, I ...
3
votes
3
answers
317
views
Flutter app gets crash after update: java.lang.IllegalAccessError, how to avoid this problem?
Flutter app crashes after update in play store
I had massive amount of crash at google play console with this type of error: java.lang.IllegalAccessError
About 20% of user had this crash when updated ...
0
votes
0
answers
76
views
Filter Listview using Searchview with Custom Adapter in Kotlin
I'm new to android and would like to get some help. I have created a list view in my android and have implemented a search filter method using searchview to search for the name of the image from the ...
1
vote
1
answer
49
views
SQFLite: How to make a "SELECT table WHERE LIKE '%a word%'" query
I am new to flutter and SQFlite, and I have multiple instances in my 'category' column, in some inserts I have two or more instances in the same value separated by ","
For example:
'INSERT ...
3
votes
1
answer
41
views
Validate Backup ZIP File
Using this code, the user can zip my database, shared preferences and other internal app data as a backup file.
The file looks like this:
The user has also the option the restore the backup file by ...
0
votes
2
answers
81
views
SQL query is not working when I am using Equals query
Database :
if (DatabaseUtils.queryNumEntries(foodDBHlpr.getWritableDatabase(),FoodDatabaseHelper.TABLE_NAME ) < 1) {
foodDBHlpr.insertFood("John", "Mashed potato");
...
1
vote
2
answers
43
views
How can I get rows from a table with the max value (all equal rows) for each different value of another row?
In an Android App I'm developping, I need to get info on a table depending on 2 rows (so with pairs) but can't really find a way to do it. How could I achieve that with SQL ?
/!\ The following is a ...
-1
votes
1
answer
39
views
Background partial/sticky concurrent mark sweep GC freed 153417(8MB) on inserting huge data to SQLite
I am developing an app for a certain for a certain shop. A shop has got almost 3883 customers (test data) and expected to be more than that. I am using Volley to fetch data to the app through APIs. ...
1
vote
1
answer
22
views
Searching from sqlite database and displaying record in EditText causes crash/restart, what went wrong?
I have a crud app project in android studio. I have done insert, update, delete and view all. The only one I'm having error with is the search function. The search code looks good to me, so it would ...