how to save a database on memory card as a file ?

by » Tue, 13 Jan 2009 01:09:11 GMT

Sponsored Links
 Can i save a database on memory card as a file ? and how to do it ?

Please give me a sample code,thanks


how to save a database on memory card as a file ?

by Sundog » Tue, 13 Jan 2009 03:41:47 GMT

 I did it the "trivial" way, write out sql statements to rebuild it
into a text file. If there's a more direct way I'd love to hear it.


Sponsored Links

Other Threads

1. [WTA] Kartu IM2 Unlimited bisa dipakai di HH Android GSM?

mestinya nggak ada masalah, tinggal set APN-nya IM2 aja di HH nanti. SOL.

2011/4/4 Freddy 'Panda' <>


2. Is CursorAdapter ok to use?


I got an ANR in an application which used the CursorAdapter, and I
started thinking if it's allowed to be used or not.
It's pretty common to create a ListActivity (or just an Activity with
a ListView) and set a CursorAdapter as adapter to it. However when the
data set changes, the CursorAdapter gets the callback and calls
requery (of it's enabled of course). However this requery could result
in a database access, which is really bad in the main thread (like in
my case).

This is the stacktrace:

android.database.sqlite.SQLiteDatabase.lock (
android.database.sqlite.SQLiteQuery.fillWindow (
android.database.sqlite.SQLiteCursor.fillWindow (
android.database.sqlite.SQLiteCursor.getCount (
android.database.CursorWrapper.getCount (
android.database.MergeCursor.getCount (
android.widget.CursorAdapter.getCount (
android.widget.BaseAdapter.notifyDataSetChanged (
android.database.AbstractCursor.requery (
android.database.sqlite.SQLiteCursor.requery (
android.database.CursorWrapper.requery (
android.database.MergeCursor.requery (
android.widget.CursorAdapter.onContentChanged (
android.os.Handler.handleCallback (
android.os.Handler.dispatchMessage (
android.os.Looper.loop ( (
java.lang.reflect.Method.invoke ($
( (

So, does this mean that simply using CursorAdapter (with
autoRequery=true) is dangerous? If yes, what is the proper way to use

Thanks in advance!
/Pal Szasz


3. Install Applikasi di External SD untuk Samsung Galaxy SL

4. Salam kenal dan WTA memilih HH

5. Android app download stats not updating

6. ORMs for Android

7. Gallery default item selected is in center