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

Populating Listview with all column of a Prepopulated Table

I want to fetch the data from the database and show the, in a listview,I've created an Arraylist and by means of this connected the listview to the database, but I'm only able to show the details of one column in each row, but what I'm looking for…
user1831490
-1
votes
2 answers

Trouble with Constructor with helper

VPAdapter.java public class VPAdapter extends PagerAdapter { public static String[] titles; public final Context context; public int[] scrollPosition; JSONArray categories = null; JSONArray newstype = null; …
Eric
  • 1,547
  • 2
  • 18
  • 34
-1
votes
1 answer

android generic SQLite database

i developed a small java.lang.reflect.InvocationHandler that intercepts method calls (from a json webservice) and cache the results to a local SQLite db. if there is no internet connection results are read from local cache. everything works fine; my…
-1
votes
2 answers

How to Fill a Spinner with Database Info

I have a spinner that I need to fill with information from a database, but the examples that i found don't work. Here is my code: public void consulta() { AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(this, "administracion",…
dakairus
  • 43
  • 1
  • 7
-2
votes
2 answers

Can't write data into SQLite database Android Studio (Java)

I'm trying to save data into a sqlite db, i have looked around but the strucutre for the helper is always this, i can't find out what's the problem. I don't get any exception, just is impossible write data into the db public class DBhelper extends…
-2
votes
1 answer

Is it better to keep DatabaseHelper open or close and re open on android app?

I have an android app that constantly inputs data on a database (sqlite). every 3 or 6 seconds (sometime is less than that) I insert data into the DB. I created a DatabaseHelper (SQLiteOpenHelper) object which does that but I've been wondering if…
-2
votes
1 answer

how to implement login for user having multiple role assigned in Android?

I have been researching on how to implement user roles in android applications but am not finding any examples. having 3 kinds of user student, teacher and admin I want after login based in their roles to get specific permission...
-2
votes
2 answers

How to allow database operations to take place in a fragment?

I am new to database in Android but now I know the way to apply CRUD (Create, Read, Update, Delete) operations on an activity but in case of fragments, getWritableDatabase() is not working. I would like to know the best way to apply CRUD operations…
-2
votes
1 answer

Databases created but table not crated in SQLite

I want to create a database for Android Application using android studio 3.5 and using SQLite. i have using follow code, but using that code just database create not tables crete inside that database. help me anyone. MainActivity.java package…
-2
votes
1 answer

I can't insert data

I'm making an app to insert data. But when I click on add button by giving all the details. App return me to previous page This is the way I create insert class public class InsertStudent extends AppCompatActivity { Button…
Nadisha
  • 3
  • 4
-2
votes
1 answer

Accessing Database created in one activity from another activity

I have created an instance of my database helper class in the main activity. I want to access that instance from any another activity where I can update that database. I have created an instance with getApplicationContext() as context but it's…
-2
votes
1 answer

How can I use the SQLite SUM() function?

* My problem Recently, I ran some of my Java code [Open Helper] through android studio , and it gave the following error : I have an login page with android (java code) and just my problem when time that must be password just string put , will be…
Amin
  • 342
  • 4
  • 15
-2
votes
1 answer

I am getting date from sqlite using sqliteOpenHelper in Android and adding 70 days from that day

I am getting date from sqlite using sqliteOpenHelper in Android and want to add days like 42, 70 etc Getting date is fine adding 42 from current date is fine but then I add 70 thats thats not working fine. Here is the code example
-2
votes
1 answer

I can not see list items in ListView

I am writing simple phone contact. I add people's names,phones,e-mails. Only names must be shown in listView. I can see list's row, but can not see names on rows. They are invisible. This method is showing infos of people: public List
-2
votes
1 answer

Updating column in Database does not work

I have a column with Names and another with Score. I am trying to update the score in the Database everytime I press a certain button which adds a certain amount of points to the Database, but it is not working. How would I properly get data from…