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

What parameters I need to use to enter SQLiteOpenHelper class - AndroidStudio

I'm currently working in one project and I need to delete one SQLiteDatabase by using a button. So, I called the onClick "deletar" on the button: public void deletar (View view){ Dados_familiaOpenHelper dados_familiaOpenHelper = new…
Ulivai
  • 121
  • 4
-1
votes
1 answer

How can I know my SQLite Table has my desired turple( attribute name )?

I just want to do like that _ I have OrderTable and OrderID, OrderItemQty are save in it. What my problem is , I want to know the order I added is still exist in my database table or not by its OrderID. If I add one order that still exist in my…
KyawLinnThant
  • 617
  • 1
  • 9
  • 20
-1
votes
1 answer

How to save data in a few places

how can I put data from my database in several places to save different data. I do not know if this is a completely understandable question, which is why I will try to bring them a bit closer. I would like to save the names of dishes for each day of…
-1
votes
1 answer

How to retrieve a single image from a SQLite database

I am able to save the images in the database. The issue i have now is with retrieve it and making use of it in the code. Look at my DATABAse handler get method: ImageClass getImage(int state_id) { SQLiteDatabase db =…
-1
votes
1 answer

How to migrate exsiting Sqlite database with new one that has changed COLUMN name ? Android

Hi I have a notepad application on play store and has users data ... the app without those new changes can update , export& import backup and runs perfectly with no problem. but when I changed my old SQLiteOpenHelper arrangement , now it doesn't do…
Khamkhor
  • 29
  • 8
-1
votes
1 answer

Trying to insert a row in an sqlite database in android NoSuchTable exists

I am a rookie in databases. At the moment I have created an app and I want to link it to an SQLite Database. After following a tutorial in youtube, I have tested my database by trying to add a simple row. I get an error E/SQLiteLog: (1) no such…
-1
votes
1 answer

My app is getting stopped when I am trying to insert the data in sqlite database

public boolean check() { db=SQLiteDatabase.openDatabase("Hotels",null,SQLiteDatabase.OPEN_READONLY); String query="Select * from hot where email='x' and phone='w'"; Cursor c=db.rawQuery(query,null); …
Sumit Kapoor
  • 1,089
  • 12
  • 10
-1
votes
1 answer

cursor throwing null pointer at cursor.close(); when called using getContentResolver().query() method

I am trying to make an app in which I can store and view my daily lectures, using sqlite. Everything was working fine before i started using the content provider. Whenever I try to query from the database it returns a null cursor. Moreover, I cant…
-1
votes
1 answer

Android Studio Application crash on database insertion

When I call function 'test' my app crashes. Any ideas why does that happen? DB class package com.example.paulcosma.app2; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import…
jeaks
  • 67
  • 1
  • 10
-1
votes
2 answers

How do I make my Android app insert record only if it doesn't exist else display a Toast or Message?

I need to enter username & password in edittext & store them into a database on clicking a button. They shoud be stored only if the any other record doesn't have same username. This one causes app to crash public void updateDB(){ username =…
Sooraj
  • 67
  • 1
  • 6
-1
votes
1 answer

SQLite Database fails to update row despite returning 1

I display a listview with database rows. When a row is clicked, a dialog pops up with the (editable) items of that row. public class ViewDataActivity extends ListActivity { private ListView listView; HashMap results = new…
Jay
  • 1,392
  • 7
  • 17
  • 44
-1
votes
2 answers

Constructor cannot be applied

i was doing this tutorial on Android Studio Development Essentials 6th Edition, the tutorial was about SQLiteDatase so i wrote evrything but i kept on getting an error whenever i try calling the Product Constructor everything is correct on the book…
Mohamed Osman
  • 136
  • 2
  • 16
-1
votes
1 answer

Getting specific row with Cursor and SQLiteDatabase

Getting some problems retriving rows of a table using Cursor. I have 3 tables: contacts,match and player (this last comes out from nxn relation). What i want is to retrieve all my match (current user login) giving as input my id. Here are my tables…
Koalito
  • 31
  • 1
  • 4
-1
votes
1 answer

Update Sqlite Table in Android

I am getting a error when updating my table... Error: android.database.sqlite.SQLiteException: near ".40609543": syntax error (code 1): , while compiling: UPDATE login SET lname=?,profile_pic=?,email=?,fname=?,mobile=? WHERE…
-1
votes
1 answer

How to copy dbsqlite file from assets into a app directory in real device

I have made all the database and was working on emulator so injection of database was easy using the Android device monitor. But in real device I have to programmatically copy it from the Assets folder to the app directory . And I have used so many…
Allay Khalil
  • 674
  • 3
  • 11
  • 31