Tag: sqlite

unknown error (code 14): Could not open database

I have a working app which employs a database and SQLiteAssetHelper. The database file (sql.sqlite) is zipped (sql.sqlite.zip) and put in the assets/databases folder. The program works perfectly well. And when run for a second/third/fourth… time it starts up quickly. But if I do a “force stop” followed by a “clear data” then run it […]

SQLiteAssetHelper NullPointerException only on some devices

I am using SQLiteAssetHelper library to deal with my App DB operations and it’s working fine for almost every phone I’ve tested with. However some users with Android 2.3.3 – 2.3.7 report crashes when a call to open the db is made. I suspect this is due to some issue occuring the first time the […]

In Android, check if sqlite database exists fails from time to time

In Android I use the following method to see if the sqlite database exist and if I can open it and use it. If it fail this test I copy the database file from the assets (this should only happen once, when the user first start the app). /* * Check if the database already […]

Sqlite Browser goes non responsive while inserting data into sqlite

I am developing and android application for ELearning purpose.Now in this application I want to store the questions and answers in the sqlite database.My following query works fine when the question/answer is of 1 line only.But application hangs when i try to enter a multiline answer. Please help me how to resolve it or suggest […]

What is the best primary key strategy for an online/offline multi-client mobile application with SQLite and Azure SQL database as the central store?

What primary key strategy would be best to use for a relational database model given the following? tens of thousands of users multiple clients per user (phone, tablet, desktop) millions of rows per table (continually growing) Azure SQL will be the central data store which will be exposed via Web API. The clients will include […]

SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)

So in some rare instances, I’m seeing the “attempt to write a readonly database” message, and I can’t figure out where the problem lies. I’ll start with the stacktrace in my logcat… as you can see from the timestamp I’m checking db.isReadOnly() only 1ms before I attempt the write. (isOpen=true, readOnly=false) 01-29 13:47:49.115: D/AWT(11055): #479.Got […]

Searching in multiple columns using Full Text Search(FTS) with multiple tokens using OR operator

I am using FTS for querying my database for increasing the search speed as I need to search in text description also, When I am trying to query using single column its working fine like below select * from productsearch where productsearch match (‘prod_name:panasonic*tw*’) And also, select * from productsearch where productsearch match (‘prod_short_desc:samsung*s5*’) So, […]

Getting ArrayIndex out of Bounds Exception when adding new items to list while scrolling

I have a ListView in which I load data from SQLite by setting a limit of 3 data from SQLite when scrolling the list I have used AsyncTask to load another 3 data from the database, but when the new data is loaded it shows me an error: ArrayIndexOutOfBoundsException. Adapter: public class FarmerAdapter extends BaseAdapter […]

Searching a SQLite database which contains cyrillic data

I have a problem searching my SQLite database, which contains data written with cyrillic characters. If the key word is also cyrillic, then everything is ok, but if not, then I can`t get the result in my Android application. Does anyone have an idea how can I implement searching the cyrilic data no matter the […]

Android SQLite query order issue

How can I query a database to display a table with data by two different IDs, yet alternate each ID per row and yet still order by time. For example. Database has 10 Elements of ID1 and 10 Elements of ID2. I need it to be: ID1 #data #2minutes ago ID2 #data #15minutes ago ID1 […]

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