All Questions
693 questions
0
votes
0
answers
127
views
Android Studio SQLiteOpenHelper <column definition name> or <table constraint> expected, got 'no'
"CREATE TABLE " + ItemList.TABLE_NAME + "( " +
ItemList._ID + " INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," +
ItemList.COLUMN_NO + " INTEGER NOT ...
1
vote
2
answers
54
views
SQLite Cursor initializing as -1 and causing error
hoping someone can help me figure this issue out. I'm trying to build an app in Android Studio for school and am running into an issue when trying to get it to load results from a database using a ...
-1
votes
1
answer
38
views
Set Date Criteria in getContentResolver().query for Uri.parse("content://sms/inbox")
I use
Uri.parse("content://sms/inbox")
when executing
getContentResolver().query
I want a selection that will always return messages from within the last 10 days of the current system date....
2
votes
1
answer
69
views
Why don't we use moveToFirst() in bindView?
When implementing onLoadFinished(), it requires moveToFirst() to work well, but why isn't this required when implementing bindView() for CursorAdapter? And when to use it?
onLoadFinished:
@Override
...
0
votes
1
answer
75
views
Android SQLite: I can't select with integer field
I can't run this code in android using java and sqlite.
This code doesnt work:
Cursor c = read.rawQuery("SELECT * FROM frentista WHERE cast(codigo as text) = '4",null);
this code works:
...
1
vote
1
answer
81
views
Attempting to use insert_last_rowid()
I am attempting to assign the plan_recipe variable in the createPlan method with teh autoincremented id of the createPlanRecipe method. I've attempted to use the insert_last_rowid() method but am ...
0
votes
0
answers
137
views
Deleting the top item of SQLite database causes the app to crash
I am using an SQLite database class that I found online. When I delete the top item and try to reload the database the app crashes because the database does not reasign IDs. This means that for two ...
1
vote
1
answer
19
views
How can I call service class when database is not empty
How can I check if the cursor is empty or if there are any contacts in the contact list of the phone?
When database is not empty then it call my Shake Service class but this logic does not works
...
-1
votes
3
answers
66
views
SQLite selecting all from multiple tables and reading from cursor
I have a query which retrieves data from different tables
select * from customer c, order o where c.id = o.pID
both tables have a column 'date_created' and i want to retrieve the date_created from ...
0
votes
1
answer
57
views
Running SQLite query in Android
I am new to SQLite queries in android. Trying to run a query. However, app keeps crashing with the following error :
Caused by: java.lang.IllegalStateException: Couldn't read row 1, col
-1 from ...
0
votes
2
answers
122
views
Sqlite : ArrayIndexOutOfBoundsException when try to fetch array from database
i have create a table in sqlite that giving me java.lang.ArrayIndexOutOfBoundsException here is code while returning the array value.
Cursor res = database.rawQuery("select "+QsDatabaseHelper....
0
votes
1
answer
43
views
Android - Fetching string data from sqlite and change listview input with if condition
I am fetching data from sqlite and displaying in a list view. All the data in sqlite is stored as String. For example,
ImageName UploadStatus
test1.jpg 1
test2.jpg 2
I am using cursor ...
0
votes
1
answer
53
views
cursor function to avoid repetition in sqlite database
I have a sqlite Database, which contains transport stations, i duplicated some stations in the database because they are in different lines, so i used a cursor :
@Override
public void ...
0
votes
1
answer
455
views
Code returns column name but column count is zero in Kotlin
I'm trying to fetch the whole data in a database and this is my code that does that.
private fun readAllPoetsDB(): Cursor {
val db = readableDatabase
return db.rawQuery("...
0
votes
1
answer
193
views
Reorder cursor data
Is there any way to load some data from sqlite cursor, and update existing column data with custom calculation and re-order cursor rows by that column in android studio? I do not want to commit new ...