Tag: sqlite

A strange behavior for regualr sqlite operation on android

I had a problem which I already solved but I still wants to know WHY the solution solved it. I wrote an android app that had a sqlite db after a couple of times I debugged it The oncreate method in the db didnt got called (even though everything worked fine before) After I changed […]

How careful should I be with thread-safety when creating methods/activities which interact with SQLite database?

I am creating an app which allows for many different Activities to be started from a TabActivity(up to ~25). Most of the activities require data from the sqlite database, so when onCreate is run, an AsyncTask creates an SQLiteOpenHelper object(which will open a readable/writable database), runs a query, data is retrieved, and everything is then […]

Keeping SQLite data after update

I have an app that has an sqlite with 3 tables. My concern is that, if I introduce an update that adds another table (so that’s 4 tables) then the updated version will wipe out the database. How can I backup/restore db given that the backup happens before the update and the restore after the […]

Does PhoneGap / Apache Cordova propose an API for encrypted SQLite database

I would like to know if it’s possible when using PhoneGap/ Apache Cordova to create/access and encrypted SQLite database. I read I can encrypt before storing/ decrypt after but that’s not what I am looking for. I am rather looking for a PhoneGap plugin or API using something like: http://sqlite-crypt.com/ Looking for something like this […]

How do I refresh my ListView after the database changes?

I am trying to manage a simple list in an Android application. The contents of the list are maintained in a SQLite database. When the user selects and holds on a specific row, a context menu appears with a “Delete” option. When they select “Delete”, the row is deleted from the database, but the view […]

Is SQLite on Android built with the ICU tokenizer enabled for FTS?

Like the title says: can we use …USING fts3(tokenizer icu th_TH, …). If we can, does anyone know what locales are suported, and whether it varies by platform version?

Android: ListView with CheckBox, populated from SQLite database not quite working

As with several other posts here, I am trying to create a ListView that includes a CheckBox for each row, and use a SQLite database to store the current state of the selection. Starting with the example at http://appfulcrum.com/?p=351, which did not quite work as is, I created a simple app that creates the database, […]

How to compare String representations of doubles if it ends in .00

I am currently writing test cases for a ContentProvider in my application (which is a checkbook recording app) and I am having a test fail when it is comparing double values. The best way to illustrate this is with code. I have this function that returns ContentValues for an account object to be inserted into […]

How do you determine if an .sqlite or .sqback is corrupt in Java?

I have been given a directory of directories each containing a collection of .sqlite and .sqback files that I must parse. The problem is that I believe some of these files to be corrupt when I receive them because I get the error: ERR: [SQLITE_CORRUPT] The database disk image is malformed (database disk image is […]

EditText afterTextChanged not working

I insert Uri image into SQLite by using below code: Register private void insertData( String name,String pass, Uri image) throws SQLiteException { database = mdb.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(MyDatabaseHelper.KEY_NAME, name); cv.put(MyDatabaseHelper.KEY_PASSWORD, pass); try { database = mdb.getWritableDatabase(); InputStream iStream = getContentResolver().openInputStream(image); byte[] inputData = Utils.getBytes(iStream); cv.put(MyDatabaseHelper.KEY_IMAGE,inputData); }catch(IOException ioe) { Log.e(TAG, “<saveImageInDB> Error : […]

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