Questions tagged [sqliteopenhelper]

SQLiteOpenHelper is a class from the Android SDK which can be used for easier handling of a SQLiteDatabase.

Using the SQLiteOpenHelper only requires implementing its two abstract methods(other methods for different events can be implemented if the user chooses) onCreate(used for initializing the database) and onUpgrade(used when the database is being changed). The Android system will call this methods according to the state of the database( not created/created/upgrading) and in return, it will offer the user a valid SQLiteDatabase reference with the methods getWritableDatabase() and/or getReadableDatabase(). More information can be found in the documentation for the SQLiteOpenHelper class.

801 questions
-1
votes
1 answer

Adding Multiple Items to SQLite Database Android

I am creating an Android Food Delivery App where menu items need to be added to the database while adding to the cart. For that, I have used SQL database with SQLiteAssethelper library. Now the problem: Please understand this carefully. In my…
-1
votes
1 answer

I want to create a SQLite database like in the images how do I do it? I just want to know how to I create the link column so as to link databases?

Database 1 Database 2 I want to know as to how to link one database to other one. For Example The Apps column in the days table should open one instance of the Apps table with the following date.
-1
votes
1 answer

How to set Autoincrement Id starts with Even Or Odd Number in SQLite With Flutter?

How to set Autoincrement Id starts with Even Or Odd Number in SQLite With Flutter? As we have solution for MySQL but for SQLite is there any way to set Autoincrement starts with Even Or Odd Numbers
galaxy
  • 19
  • 2
-1
votes
1 answer

Why is my android app crashing when I'm trying to delete a row from SQLite database? Kotlin

So I'm creating a GitHub mobile where I can search for users and look at the profile. I'm trying to create a favorite feature where the user can be added to favorites database when clicking the button in the details page. I've already created the…
-1
votes
1 answer

SQLite "select * from table" doesnt work in android studio

I create a DatabaseHelper class that extends SQLiteOpenHelper in Android Studio. The getBuildingData function doesn't return any data. The data table creates and all data inserts into table successfully, but the cursor in the getBuildingData…
-1
votes
1 answer

Why sqlite database is not being created?

I know this a duplicate question but I have searched all of the same questions and nothing solved my problem. I am trying to create a sqlite database that contains one table(users_information) when the user presses the register button I check if his…
-1
votes
1 answer

Android Java No such file or directory when importing sqlite database

I am trying to import an sqlite database so that is overrites the one that is currently there. I have managed to export the database to a file in a folder on the phone, but when i try to import it i get the Exception that says " no such file or…
Dwayne T
  • 95
  • 2
  • 8
-1
votes
1 answer

read from ready database in android studio

hello please I need your help All of this month I tryed to know how to read data from ready database (sqlite.db) in project .. I want to make a database and I full it befor I ready it (for example a book) then i want to show this detales in a text…
-1
votes
1 answer

Why does cursor.getString() line crash the app?

The app crashes whenever it reaches the line where cursor.getString() is executed. I've tried both cursor.getString() and cursor.getString(cursor.getColumnIndex(" ")) but it still crashed The method it's executed on: public void populateView(){ …
OJDylan
  • 27
  • 7
-1
votes
1 answer

How to use SQLite data with reusable RecyclerView adapter

I'm looking to use some data that has been declared in a Fragment so it can be displayed as RecyclerView items. The problem is with myList and I understand that there is a type mismatch. However, I created the database table rows in the onCreateView…
wbk727
  • 8,017
  • 12
  • 61
  • 125
-1
votes
1 answer

Can't copy pre-created db from assets

android cant copy my pre create db from assets , the old db still exist in data/data/packagename/dabases, i want to change old db with new one ive tried to change this.getReadableDatabase(); into SQLiteDatabse db = this.getReadabledatabase() if…
-1
votes
2 answers

How to insert your own image into a SQLite table?

I have made a table with user info already stored in it. When the user registers with the id, all the details like username, course are retrieved from the table if the id matches. Now I want to add profile pictures in my user info table. Almost all…
-1
votes
1 answer

Android libgdx: NullPointerException on SQLiteOpenHelper database

I am trying to write a code in my game to save the score when the player dies. For that purpose I implemented an interface to use SQLiteOpenHelper (the interface is in the core project and the SQLiteOpenHelper is in the android project). For anyone…
MarcusF
  • 43
  • 7
-1
votes
1 answer

ArrayIndexOutOfBoundException to delete single record

I am using external database with prefilled data. The user can also perform CRUD operation in that database. But when I am deleting the record its throwing the Array out of bound exception. Here, is my snippet from code which I implemented for…
-1
votes
1 answer

Android app crashes on clicking button to send a textview to SQL litein emulator

The code I have developed was in Android Studio. I am currently trying to make an app that upon clicking a button it will send the text in a textview to a database created via SQLite. However upon clicking the button the the app is crashing on the…