Android and SQLite, a REALLY easy tutorial that anyone can do

Howdy folks! Time for some more android fun. I’ve been meaning to explore some of the SQLite functionality for some time, as I require it in my Cerca de mí application, so heres a real quick and dirty overview of how to get going.

I know you want some source code to lift, but lets just have a quick chat about how this ol’ chesnut works.

Think of it this way, you’ve created some application on Android, and young Johnny downloads your game and plays it. He kills the arch-enemy Galron in under 2 minutes flat and he wants to save his score to brag to his chums about, how does that work in Android terms? Well, one option is to create a SQLite database for your application and use that to store application data such as high scores, usernames, perhaps even data required for your applications logic? (maybe some cool new items after killing that boss?).

Enough talk, create a new android project in the IDE of your choice and copy in the following into src/com/jameselsey/Main.java

//   Quick and dirty SQLite example for Android
 
package com.jameselsey;

import android.app.ListActivity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import java.util.List;

public class Main extends ListActivity
{

    private static String SAMPLE_TABLE_NAME = "PERSONS_TABLE";
    private SQLiteDatabase sampleDB = null;
    private List<String> results = new ArrayList<String>();
    private Cursor cursor = null;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        try
        {
            sampleDB = openOrCreateDatabase("NAME", MODE_PRIVATE, null);
            createTable();
            insertData();
            lookupData();
            this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,results));
        }
        catch (SQLiteException se)
        {
            Log.e(getClass().getSimpleName(), "Could not create or Open the database");
        }
        finally
        {

            if (sampleDB != null)
                sampleDB.execSQL("DELETE FROM " + SAMPLE_TABLE_NAME);
            sampleDB.close();
        }

    }

    /**
     * Create a table if it doesn't already exist
     */
    private void createTable()
    {
       sampleDB.execSQL("CREATE TABLE IF NOT EXISTS " +
                    SAMPLE_TABLE_NAME +
                    " (PERSON_NAME VARCHAR, " +
                    "  COUNTRY VARCHAR, " +
                    "  AGE INT(3));");
    }

    /**
     * Insert some test data, modify as you see fit
     */
    private void insertData()
    {
        sampleDB.execSQL("INSERT INTO " + SAMPLE_TABLE_NAME + " Values ('James','ENGLAND',25);");
        sampleDB.execSQL("INSERT INTO " + SAMPLE_TABLE_NAME + " Values ('Dave','USA',18);");
        sampleDB.execSQL("INSERT INTO " + SAMPLE_TABLE_NAME + " Values ('Jean-Paul','FRANCE',33);");
        sampleDB.execSQL("INSERT INTO " + SAMPLE_TABLE_NAME + " Values ('Sergio','SPAIN',42);");
        sampleDB.execSQL("INSERT INTO " + SAMPLE_TABLE_NAME + " Values ('Hitori','JAPAN',73);");
    }

    /**
     * Run a query to get some data, then add it to a List and format as you require
     */
    private void lookupData()
    {
        cursor = sampleDB.rawQuery("SELECT PERSON_NAME, COUNTRY, AGE FROM " +
                SAMPLE_TABLE_NAME +
                " where AGE > 10 ", null);

        if (cursor != null)
        {
            if (cursor.moveToFirst())
            {
                do
                {
                    String personName = cursor.getString(cursor.getColumnIndex("PERSON_NAME"));
                    String country = cursor.getString(cursor.getColumnIndex("COUNTRY"));
                    int age = cursor.getInt(cursor.getColumnIndex("AGE"));
                    results.add("" + personName + ", " + country + ", " + age);
                } while (cursor.moveToNext());
            }
            cursor.close();
        }
    }
}

This is the whole tutorial pretty much in one class. What we do is call out to various private members in the onCreate method. Firstly we need to create the table to store those highscores in (thats it Johnny hasn’t already played the game and created it already).

Next we’re going to insert some data, this is the key part. For this tutorial I’m happy inserting some static test data just to prove the point, but in your real life application you probably don’t want to do this, as you’ll be inserting data from other means.

Next we lookup the data, just a simple SQL select statement, nothing fancy here, but what we do is to create a List of results from that query, which we use to pass through an Adapter so it comes out the other end in a ListView.

That is pretty much it to be honest! I won’t post up AndroidManifest.xml or strings.xml since there are no changes there, but you might want the following res/layout/main.xml

<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
              android:layout_width="fill_parent" android:layout_height="fill_parent">
    <ListView android:id="@android:id/list" android:layout_width="fill_parent"
            android:layout_height="wrap_content" ></ListView>
</LinearLayout>

So there we have it, in under 5 minutes you can now create a SQLite database, insert some test data into it, then read it back and display on the screen. I’ll do some more in-depth SQLite tutorials in the future, please check back!

James

Loading Facebook Comments ...

12 thoughts on “Android and SQLite, a REALLY easy tutorial that anyone can do

  1. Hi, ” I won’t post up AndroidManifest.xml or strings.xml since there are no changes there, but you might want the following res/layout/main.xml” What files are these in reference too? Can you direct where I can find these so i can test the project you posted? Thanks!

    • Hi Philip, thanks for the comment.

      I’m a little unsure what you’re asking for, the snippet I posted from main.xml is the layout that you’ll need to have for that sample to work. In other words, you’ll need that so you can create a list and display them on the screen.

      Does that answer your question? I don’t have access to my android development code at the moment, but over the weekend I’ll revisit this tutorial and try and get my code hosted up on Github.

      thanks

  2. Hi James, you don’t provide the strings.xml or AndroidManifest file for this example. Are these files from your other tutorials ok to use for this example? (with some modification presumably)

    Thanks!

  3. Hi James,

    I’m a noob to Android/Java programming. Over the past few months, I have learned a lot about developing Android apps using the Eclipse platform. I’m trying to incorporate a database into an Android game app for recording member info, top score, etc.

    I tried out your your Android and SQLite project and it worked like a charm. Thanks for your tutorial and easy to follow coding.

    Next, I’m trying to use your project to develop 3 separate classes that can be accessed with a menu that I set up: (i.e., CreateDatabase, Insert Data, and ReadData) using your createTable(), insertData(), and lookupData() methods.

    For example, I removed the createTable() and insertData() methods from your main activity and put all the rest of the Main.java code into a new class (Display.java) that is accessed by the menu. When I run the activity, I get a blank (black) screen. At this point, I’m clueless. Can you help me resolve why I don’t get the same database output that is produced by the entire Main activity since the database information should already exist in the database from previously running the Main activity.

    Thanks and best regards,
    Terry

    • Hi Terry,

      Thanks for the kind words! Glad I’ve helped.

      Seems like you got some good work going on there, its really difficult for me to speculate what the problem is without seeing your code, but here are a few things that immediately spring to mind

      Check the debug log, does it complain about anything?
      Add some break points in your activity, so when you enter them, you hit the breakpoint, and you can step through your code line by line and see exactly whats happening. IntelliJ IDEA has a nifty feature where you can query any object for its state (evaluate expression), I’m sure eclipse has something similar.
      What do you expect on the screen? Instead of posting to the UI, do whatever you need to do then spit out the results into the Log (such as some data you lookup). If you can get stuff into the log, then you’re halfway there
      When you say “put in different classes”, do you mean different activities? If so, which layout file are they using? Maybe they load some blank layout which is why you don’t see anything
      Stupid question, but are you sure your code even makes it into those classes?

      Let me know how you get on, and good luck!

      Regards
      James

  4. James,

    Once again, thanks for your input and great suggestions. I used the “break point” and “Log.d” functions to track down the problem.

    As it turns out, your code in the try-catch-finally section was deleting the database contents after you created, inserted data and lookedup the data in the Main activity. So when I tried to read the database contents in my separate Display activity, the database contents turned out to be empty. :(

    My solution was to “comment out” the line of code “sampleDB.execSQL(“DELETE.. “). As a result, the database data remained intact and my code worked perfect when I read the database in the separate Display activity. :)

    Thanks and best regards,
    Terry

  5. Hi James,

    I am new to Java and Android. I got an error message that the process is failed to start activity (on emulutor). I inspected LogCat and found so many errors there, i paste the logcat (errors) below. Can you please help me to fix this? 04-25 21:19:25.866: ERROR/Zygote(33): setreuid() failed. errno: 2
    04-25 21:19:39.026: ERROR/Zygote(33): setreuid() failed. errno: 17
    04-25 21:19:40.546: ERROR/BatteryService(61): usbOnlinePath not found
    04-25 21:19:40.546: ERROR/BatteryService(61): batteryVoltagePath not found
    04-25 21:19:40.546: ERROR/BatteryService(61): batteryTemperaturePath not found
    04-25 21:19:40.566: ERROR/SurfaceFlinger(61): Couldn’t open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
    04-25 21:19:40.806: ERROR/SensorService(61): couldn’t open device for module sensors (Invalid argument)
    04-25 21:19:48.117: ERROR/System(61): Failure starting core service
    04-25 21:19:48.117: ERROR/System(61): java.lang.SecurityException
    04-25 21:19:48.117: ERROR/System(61): at android.os.BinderProxy.transact(Native Method)
    04-25 21:19:48.117: ERROR/System(61): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
    04-25 21:19:48.117: ERROR/System(61): at android.os.ServiceManager.addService(ServiceManager.java:72)
    04-25 21:19:48.117: ERROR/System(61): at com.android.server.ServerThread.run(SystemServer.java:206)
    04-25 21:19:48.177: ERROR/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
    04-25 21:19:48.177: ERROR/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
    04-25 21:19:49.227: ERROR/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg
    04-25 21:19:49.237: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg
    04-25 21:19:49.247: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
    04-25 21:19:49.268: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg
    04-25 21:19:49.287: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg
    04-25 21:19:49.357: ERROR/UsbObserver(61): java.lang.NullPointerException
    04-25 21:19:49.357: ERROR/UsbObserver(61): at com.android.server.UsbObserver.init(UsbObserver.java:131)
    04-25 21:19:49.357: ERROR/UsbObserver(61): at com.android.server.UsbObserver.(UsbObserver.java:65)
    04-25 21:19:49.357: ERROR/UsbObserver(61): at com.android.server.ServerThread.run(SystemServer.java:402)
    04-25 21:19:50.427: ERROR/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf
    04-25 21:20:23.367: ERROR/logwrapper(165): executing /system/bin/tc failed: No such file or directory
    04-25 21:20:23.407: ERROR/logwrapper(166): executing /system/bin/tc failed: No such file or directory
    04-25 21:20:23.577: ERROR/logwrapper(167): executing /system/bin/tc failed: No such file or directory
    04-25 21:20:28.546: ERROR/ActivityManager(61): ANR in system
    04-25 21:20:28.546: ERROR/ActivityManager(61): Reason: Executing service android/com.android.internal.service.wallpaper.ImageWallpaper
    04-25 21:20:28.546: ERROR/ActivityManager(61): Load: 4.88 / 1.29 / 0.43
    04-25 21:20:28.546: ERROR/ActivityManager(61): CPU usage from 2882ms to -6202ms ago:
    04-25 21:20:28.546: ERROR/ActivityManager(61): 41% 61/system_server: 29% user + 12% kernel / faults: 1256 minor 9 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 13% 120/jp.co.omronsoft.openwnn: 10% user + 3.3% kernel / faults: 1816 minor 6 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 13% 127/com.android.systemui: 9.2% user + 4.1% kernel / faults: 2021 minor 3 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 11% 125/com.android.phone: 7.1% user + 4.1% kernel / faults: 1674 minor 9 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 10% 131/com.android.launcher: 7.5% user + 3% kernel / faults: 1688 minor 5 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 3.8% 72/bootanimation: 2.9% user + 0.8% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1.8% 41/adbd: 0% user + 1.8% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 89/logcat: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.5% 28/servicemanager: 0% user + 0.5% kernel / faults: 5 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.2% 38/qemud: 0% user + 0.2% kernel / faults: 1 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0% 30/netd: 0% user + 0% kernel / faults: 20 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0% 32/rild: 0% user + 0% kernel / faults: 1 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 99% TOTAL: 55% user + 43% kernel + 0.3% irq + 0.4% softirq
    04-25 21:20:28.546: ERROR/ActivityManager(61): CPU usage from 3752ms to 5042ms later:
    04-25 21:20:28.546: ERROR/ActivityManager(61): 39% 61/system_server: 34% user + 5.3% kernel / faults: 219 minor 2 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 20% 99/WindowManagerPo: 20% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 7.3% 74/ActivityManager: 4% user + 3.3% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 2% 62/HeapWorker: 2% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 2% 69/SurfaceFlinger: 2% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1.3% 66/Compiler: 0.6% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1.3% 67/Binder Thread #: 0.6% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1.3% 154/Binder Thread #: 1.3% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1.3% 160/Binder Thread #: 1.3% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 61/system_server: 0.6% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 161/Binder Thread #: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 162/Binder Thread #: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 15% 120/jp.co.omronsoft.openwnn: 11% user + 3.3% kernel / faults: 450 minor 1 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 9.9% 120/ronsoft.openwnn: 7.2% user + 2.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 3.3% 124/GC: 3.3% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 143/Compiler: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 13% 125/com.android.phone: 10% user + 2.7% kernel / faults: 339 minor 1 major
    04-25 21:20:28.546: ERROR/ActivityManager(61): 10% 125/m.android.phone: 8.2% user + 2% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): +0% 170/RILSender: 0% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): +0% 171/RILReceiver: 0% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 12% 131/com.android.launcher: 9.2% user + 3.5% kernel / faults: 429 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 12% 131/ndroid.launcher: 8.5% user + 3.5% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): +0% 169/launcher-loader: 0% user + 0% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 11% 127/com.android.systemui: 9% user + 2.7% kernel / faults: 271 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 13% 127/ndroid.systemui: 9.7% user + 3.4% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 3.4% 72/bootanimation: 2% user + 1.3% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 4% 76/BootAnimation: 2% user + 2% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 1% 41/adbd: 0% user + 1% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 41/adbd: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.6% 81/adbd: 0% user + 0.6% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.3% 82/adbd: 0% user + 0.3% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.2% 28/servicemanager: 0% user + 0.2% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.2% 32/rild: 0% user + 0.2% kernel / faults: 1 minor
    04-25 21:20:28.546: ERROR/ActivityManager(61): 0.3% 89/logcat: 0% user + 0.3% kernel
    04-25 21:20:28.546: ERROR/ActivityManager(61): 100% TOTAL: 76% user + 21% kernel + 0.7% irq + 1.5% softirq
    04-25 21:20:51.380: ERROR/Database(125): CREATE TABLE android_metadata failed
    04-25 21:20:51.460: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:51.460: ERROR/Database(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:51.460: ERROR/Database(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:51.460: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:51.460: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.460: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.460: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.460: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.460: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): Couldn’t open mmssms.db for writing (will try read-only):
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.500: ERROR/SQLiteOpenHelper(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.530: ERROR/Database(125): SELECT locale FROM android_metadata failed
    04-25 21:20:51.540: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:51.540: ERROR/Database(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:51.540: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.540: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.540: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.540: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.540: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:51.540: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.540: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.540: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.540: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.540: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): Writing exception to parcel
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.550: ERROR/DatabaseUtils(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): Catch a SQLiteException when query:
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:156)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.content.ContentResolver.query(ContentResolver.java:262)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at android.database.sqlite.SqliteWrapper.query(SqliteWrapper.java:59)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at com.android.mms.util.DraftCache.rebuildCache(DraftCache.java:89)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at com.android.mms.util.DraftCache.access$000(DraftCache.java:34)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at com.android.mms.util.DraftCache$1.run(DraftCache.java:74)
    04-25 21:20:51.570: ERROR/SqliteWrapper(228): at java.lang.Thread.run(Thread.java:1019)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): FATAL EXCEPTION: Thread-12
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:156)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.content.ContentResolver.query(ContentResolver.java:262)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at android.database.sqlite.SqliteWrapper.query(SqliteWrapper.java:59)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at com.android.mms.util.DraftCache.rebuildCache(DraftCache.java:89)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at com.android.mms.util.DraftCache.access$000(DraftCache.java:34)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at com.android.mms.util.DraftCache$1.run(DraftCache.java:74)
    04-25 21:20:51.600: ERROR/AndroidRuntime(228): at java.lang.Thread.run(Thread.java:1019)
    04-25 21:20:51.842: ERROR/Database(125): CREATE TABLE android_metadata failed
    04-25 21:20:51.880: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:51.880: ERROR/Database(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:51.880: ERROR/Database(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:51.880: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:51.880: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.880: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.880: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.880: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.880: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): Couldn’t open mmssms.db for writing (will try read-only):
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.920: ERROR/SQLiteOpenHelper(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.940: ERROR/Database(125): SELECT locale FROM android_metadata failed
    04-25 21:20:51.980: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:51.980: ERROR/Database(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:51.980: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:51.980: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:51.980: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:51.980: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:51.980: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:51.980: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:51.980: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:51.980: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:51.980: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:51.980: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:51.990: ERROR/Database(125): CREATE TABLE android_metadata failed
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): Writing exception to parcel
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.021: ERROR/DatabaseUtils(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): Catch a SQLiteException when query:
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:156)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.content.ContentResolver.query(ContentResolver.java:262)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at android.database.sqlite.SqliteWrapper.query(SqliteWrapper.java:59)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at com.android.mms.data.RecipientIdCache.fill(RecipientIdCache.java:66)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at com.android.mms.data.RecipientIdCache$1.run(RecipientIdCache.java:50)
    04-25 21:20:52.030: ERROR/SqliteWrapper(228): at java.lang.Thread.run(Thread.java:1019)
    04-25 21:20:52.070: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:52.070: ERROR/Database(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:52.070: ERROR/Database(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:52.070: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:52.070: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:52.070: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:52.070: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:52.070: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.070: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): Couldn’t open mmssms.db for writing (will try read-only):
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.140: ERROR/SQLiteOpenHelper(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.160: ERROR/Database(125): SELECT locale FROM android_metadata failed
    04-25 21:20:52.180: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:52.180: ERROR/Database(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:52.180: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.180: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.180: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.180: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.180: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:52.180: ERROR/Database(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:52.180: ERROR/Database(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:52.180: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:52.180: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.180: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): Writing exception to parcel
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): android.database.sqlite.SQLiteDiskIOException: disk I/O error
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at com.android.providers.telephony.MmsSmsProvider.query(MmsSmsProvider.java:259)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:174)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.220: ERROR/DatabaseUtils(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.230: ERROR/Database(125): CREATE TABLE android_metadata failed
    04-25 21:20:52.350: ERROR/Database(125): Failed to setLocale() when constructing, closing the database
    04-25 21:20:52.350: ERROR/Database(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:52.350: ERROR/Database(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:52.350: ERROR/Database(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:52.350: ERROR/Database(125): at com.android.providers.telephony.MmsProvider.delete(MmsProvider.java:553)
    04-25 21:20:52.350: ERROR/Database(125): at android.content.ContentProvider$Transport.delete(ContentProvider.java:222)
    04-25 21:20:52.350: ERROR/Database(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:186)
    04-25 21:20:52.350: ERROR/Database(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.350: ERROR/Database(125): at dalvik.system.NativeStart.run(Native Method)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): Writing exception to parcel
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): android.database.sqlite.SQLiteException: unable to open database file
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1855)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:544)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at com.android.providers.telephony.MmsProvider.delete(MmsProvider.java:553)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.content.ContentProvider$Transport.delete(ContentProvider.java:222)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:186)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at android.os.Binder.execTransact(Binder.java:320)
    04-25 21:20:52.380: ERROR/DatabaseUtils(125): at dalvik.system.NativeStart.run(Native Method)

  6. While in debugging mode, It shows error that some sourec is missing. I have checked the same code with a new workspace, but it didnt helped me.

  7. Hi James,

    Thanks for posting such of great idea regarding speech recognition and the usage of database. Maybe if you can provide if how the speech database can be created for the android apps. I’m really in need to have such info. Thanks again

Leave a Comment


9 − = eight