Tag: sqlite

DB File in Assets Folder. Will it be Updated?

I’m new to the Android SQLite whole thing. This is what I have: I have db.sqlite in my assets folder. The intent of the db is to READ ONLY. The user will not write to it. When the app gets updated, the db.sqlite will be replaced be a new db (I’ll delete the old file […]

Android Save images to SQLite or SDCard or memory

I need to fetch images and some other data from server and then display it in the List. But as the number of records can be pretty large so I am not sure if I should save images to SQLite database or save it to SDCard or save those to memory. Thanks, nil

A simple Cordova android example including Sqlite read/write and search

I was working on an Android app project using Cordova which in I had a simple Sqlite database. ——————– ID | Name | Number | ——————– Since I’m new in android apps, I just Got the UI ready. I have two text inputs, a <div> tag to show the table data and 3 buttons. And […]

Retrieve large blob from Android sqlite database

I stored chunks of binary data (protobufs) in the sqlite database of an Android app without realizing that Android’s Cursor can only hold a maximum of 1MB of data. I now know that I should have stored these binary blobs in files and only referenced the files in the sqlite database entries. I need to […]

Random SQLiteConnectionPool error on Android. How to avoid?

Recently I started to get following error in my application. This is NOT in any specific place and I can reproduce only when loop through all data read/write functionality. It comes up pretty much anywhere. 09-14 08:52:15.089: WARN/SQLiteConnectionPool(19268): The connection pool for database ‘/data/data/com.nnn/databases/data.db’ has been unable to grant a connection to thread 1 (main) […]

Android SQLiteException: bind or column index out of range problem

In android I am using the following statement. model = dataHelper.rawQuery(“SELECT _id, engword, lower(engword) as letter FROM word WHERE letter >= ‘a’ AND letter < ‘{‘ AND engword LIKE ‘%” + filterText + “%'”, new String[ {“_id”,”engword”, “lower(engword) as letter”}); It is throwing android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x132330 What is […]

How to avoid SQLiteException locking errors

I’m developing an Android application. It has multiple threads reading from and writing to the Android SQLite database. I am receiving the following error: SQLiteException: error code 5: database is locked I understand the SQLite locks the entire db on inserting/updating, but these errors only seem to happen when inserting/updating while I’m running a select […]

H2 Database vs SQLite on Android

Because of the lack of Unicode support on the embedded SQLite database in Android I am mostly interested in performance and stability of H2 Database vs Android SQLite Are you guys using it? Should I be aware of any H2 database shortcomings?

What is The use of moveToFirst () in SQLite Cursors

I am a programming newbie and I found this piece of code in the internet and it works fine Cursor c=db.query(DataBase.TB_NAME, new String[] {DataBase.KEY_ROWID,DataBase.KEY_RATE}, DataBase.KEY_ROWID+”= 1″, null, null, null, null); if(c!=null) { c.moveToFirst(); } but I am not able to understand the use of the if(c!=null) { c.moveToFirst(); } part. What does it do exactly […]

How to update column with ORMLite

I have an already created database for Android application and I’m using ORMLite for query to SQLLite. I have added a column in category and I want to insert data in that column. I have row, e.g. catId=5 catname=”food” catType=? I want to update catType on the basis of catId. How can I update this […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.