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
-2
votes
1 answer

I am doing a small project in Android Studio and i am using SQLite .There is an error near the insert operation

public class DatabaseHelper extends SQLiteOpenHelper { private static final int DATABASE_VERSION=1; private static final String DATABASE_NAME="Original"; private static final String TABLE_NAME="Register"; private static final String…
-2
votes
1 answer

how to insert an entire csv file into SQLite at once

I created sqlite database table and i would like to populate the database table with a CSV file saved in the sd card. my question is, is there any method or approach to insert the entire csv file into the sqlite database at once instead of…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
-2
votes
1 answer

Implement Rollback Feature in android?

I would like to implement rollback functionality in android. How to get the previous data when internet is disconnected at the time of parse and inserting data. Thank you for your suggestion in advance.
-2
votes
1 answer

What is the new way of creating sql lite open helper class in android

I am new in android developer I used to use in sql lite open helper but lately I heard about a new way of creating sql lite database (maybe it's not true, I don't know ) I will be glad to hear if you guys know something about it. Thanks :)
-2
votes
1 answer

How to use two sqlite database within single application and how to use join operation with them?

I have read many questions & answers related to my question but I am not getting a proper way for doing this. Condtion: I have three tables in SQLite database. I want to update the data of two (TBL_NAMES,TBL_CATEGORY) tables without losing the data…
Ashish Tiwari
  • 2,168
  • 4
  • 30
  • 54
-2
votes
1 answer

Why SQLiteDatabase.exec() insert nothing?

First time,I ran the app and insert data by createDefaultUser() into storage.db (Database Version 1). Second time,I ran the app (Database Version 2), DatabaseManager.java functions onUpgrade() well. Logcats showed OK. But onUpgrade() there is a…
-2
votes
1 answer

quering android sqlite database without using the primary key throws an error java.lang.NullPointerException

im developing a map application in android that search for places in the database based on the user's search input. im trying to query the sqlite database using a field which will search in the database and return the latitude of the places which…
quame
  • 3
  • 3
-3
votes
1 answer

android studio :Attempt to invoke virtual method on a null object reference

can someone help me? whenever i click on the dialoginterface.onclicklistener button the app just crashes can anyone check for me my codes . ALso when i want the same dialoginterface button to retrieve the inserted data from database to be viewed as…
Lonely Bat
  • 35
  • 1
  • 9
-3
votes
1 answer

How to show Checked data and Unchecked from master table in sqlite database?

I am working in local sqlite data base, Where i am getting master data from server in the form of json and the master data is inserted in one table(master table).Based on the entries from edittext, checking the entered data is present in master…
kishore
  • 61
  • 5
-3
votes
2 answers

Error in rawQuery() in SQLite

public class DataBaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME="register.db"; public static final String TABLE_NAME="registration"; public static final String COL_1="ID"; public static final String…
-3
votes
2 answers

I want to fetch data from a database

I want to fetch data using cursor which is stored in our table events But I am unable to fetch that data. How could I do so please give me suitable and simple answer only. This is my Database class, in which I have created my database table…
-3
votes
1 answer

android.database.sqlite.SQLiteException: no such table: liongenman16b1(Sqlite code 1): , while compiling:

**I am working with a exiting database .First i create a database in sqlite manager and then put it into asserts . ** You can see my database screen shoot and here also exits my table which i am calling DBhelper class ** Error is ** …
-3
votes
1 answer

android.database.sqlite.SQLiteException: no such column: while compiling: UPDATE

I am trying to update some columns in a row in SQLite in an Android app, however I am stuck at this error which I just don't know where it comes from. android.database.sqlite.SQLiteException: no such column: location (code 1): , while compiling:…
Othmane
  • 1,094
  • 2
  • 17
  • 33
-3
votes
1 answer

I am trying to create & retrieve data from my database but "Null pointer exception" occurred

I am new to android development, i am learning working with SQLite databases, when i create a database and retrieve data from it this error show up. Kindly do let me know if any other code u needed to see. Here is my mainActivity: public static…
SajaWal NaWaz
  • 115
  • 1
  • 3
  • 13
-3
votes
1 answer

android getWritableDatabase() crashes

so I saw a lot of answers about this topic but neither worked or I didn't really understood what to do ! xD so if you answer by linking a topic that answers that fine ! I have a MainActivity where I display my stuff and all, and a class…
Yorokobii
  • 17
  • 6
1 2 3
53
54