Hi guys,

I'm implementing the app requires database set-up when installed for
the first time.

It works fine however it takes a couple of minutes wait with black
screen (default screen) while establishing database.

I understand that is necessary but would like to treat more elegant
approach for User Interface.

I'm using DatabaseHelper class inherited from SQLiteOpenHelper to
initiate database for the first time.

Here is snippet for your understanding.

================================================
private static class DatabaseHelper extends SQLiteOpenHelper

        {
                private Context dbContext;

                DatabaseHelper(Context context)
                {
                        super(context, DATABASE_NAME, null, DATABASE_VERSION);
                        dbContext = context;
                }

                @Override
                public void onCreate(SQLiteDatabase db)
                {
                        db.execSQL(DATABASE_CREATE);
                        ContentValues values = new ContentValues();
                        loadDB(db, values);
                }

                @Override
                public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion)
                {
                        Log.w(TAG, "Upgrading from " + oldVersion + " to " + 
newVersion);
                        db.execSQL(DATABASE_DROP);
                        onCreate(db);
                }


                private void loadDB(SQLiteDatabase db, ContentValues values)
                {
                        // establishing database here.
                       // it takes a couple of minutes but would like
to handle with more elegant way.
                }
}

====================================================================

loadDB() method needs operation with more sophisticated approach so
any idea or advise will be welcome.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to