Questions tagged [android-database]

General programmatic usage of databases on Android

Databases and tools related with persistence supported by the Android operating system.

584 questions
1
vote
0 answers

Android database not inserting entries

I am trying to make simple database entry app where When I click on button to initiate The Enter function it should insert some values into the database. But it's not working. The main Activity button onclick function ( variable for database…
1
vote
2 answers

Does Android Room offer SqliteOpenHelper onCreate() & onUpdate() alternative?

Using SqliteOpenHelper, I can rely on the onCreate() method to initialize some database work if the database is created for the first time. Also, using the onUpdate() method, I can easily detect if the user has an older version of the DB and I can…
Mena
  • 3,019
  • 1
  • 25
  • 54
1
vote
2 answers

Will sqlite database with user infomations gets deleted or reset after new update of app

I have a question related to database, i know this is not a right platform related to question but i know here i can find great developer. My query is, "I am going to develop an app which deal with SQLite Database and a lots of data into the…
1
vote
1 answer

Are there tools to auto-generate Android POJO classes with Room Annotations

I have been using SqliteOpenHelper in Android for a long time. In complex projects when the schema is big and there are many relationships, I use an online tool to design the ERD, then it exports for me the SQL code that builds the DB tables with…
1
vote
2 answers

Json parsing error: type org.json.JSONArray cannot be converted to JSONObject

The JSON is simple as, [{"kw":"48.90","kva":"51.20","pf":"-0.96"}] The error I get is, 08-26 02:28:49.130 13605-13641/com.whatever.emshive E/MainActivity: Response from url: [{"kw":"48.90","kva":"51.20","pf":"-0.96"}] Json parsing error:…
Nishanth Kr
  • 113
  • 2
  • 9
1
vote
1 answer

Different types of DataTypes in Realm(Android Application) DataBase?

Which datatype are use in realm database(i.e. String,int etc.)? What is the size of that DataType? (i.e. in mySQL varchar max length is 65,535.)
Arbaz.in
  • 1,478
  • 2
  • 19
  • 41
1
vote
1 answer

Insert into an Android Room table without triggering an emission?

Is there a way to silently insert/update a Room table that you're observing that will not cause an emission? I have a table where there's one specific case that I don't want to be notified of the change, but still persist it in the same table. I'm…
1
vote
0 answers

How to set list data to recyclerView from activity via interface in room persistence database?

I am using Room persistence library to store data, want to set a list of data to recyclerView from database with button click. I have got data list from database using List employees = database.employeeDao().getEmployeeList(); and Have a…
1
vote
2 answers

Best way to store dynamic data?

I am developing a launcher for Android and need some advice on designing my persistent storage system. I wish for people to be able to create different categories for their apps (e.g Media, Utilities, Social). Users must be able to choose the order…
FrazorLazer
  • 59
  • 1
  • 4
1
vote
0 answers

How to update fragments in viewpager in tablayout with database using only one fragment?

this is Sqlite helper class to retrive data from database public class Simple1 extends SQLiteAssetHelper { private static final String DATABASE_NAME = "yogalite.db"; private static final int DATABASE_VERSION = 1; private static final…
1
vote
0 answers

Search in EditText to Listview with Database

This is my first time here. I have searched a lot and do not understand the following: I have connected my database to be projected in the listview, but now I want to search or filter the listview based on the item that you input in the EditText. I…
Anne Leona
  • 19
  • 2
1
vote
0 answers

COLLATE function in Realm Android

I am working on realm Database in one of my projects. I want to implement COLLATE function(SQL) in one of my realm queries. Is there any way I can add that. My Realm Query: ArrayList = (ArrayList)…
Mehta
  • 1,228
  • 1
  • 9
  • 27
1
vote
0 answers

NullPointerException when trying to delete a row

getting Attempt to invoke virtual method int android.database.sqlite.SQLiteDatabase.delete(java.lang.String, java.lang.String, java.lang.String[]) on a null object reference Since my code is very long, parts that have nothing to do with the issue at…
Sentinal
  • 65
  • 5
1
vote
0 answers

Room Database Close during execution

I'm getting a crash report of room database not being able to execute a query because the database has already been closed. I tried reproducing this error but I can't seem to get it. java.lang.IllegalStateException: attempt to re-open an…
1
vote
1 answer

Encoding a video (mp4) in Android

I want to store a video file in sqlite database and retrieve it from the database. I can store it in database with code that I have. FileInputStream fileInputStream = new FileInputStream("/sdcard/download/video.mp4"); byte[] image = new byte…
Amir
  • 11
  • 1