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

by smc00...@gmail.com » 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' <freddyfo...@gmail.com>


-- 
===============

2. Is CursorAdapter ok to use?

Hi!

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 (SQLiteDatabase.java:378)
android.database.sqlite.SQLiteQuery.fillWindow (SQLiteQuery.java:64)
android.database.sqlite.SQLiteCursor.fillWindow (SQLiteCursor.java:
287)
android.database.sqlite.SQLiteCursor.getCount (SQLiteCursor.java:268)
android.database.CursorWrapper.getCount (CursorWrapper.java:70)
android.database.MergeCursor.getCount (MergeCursor.java:61)
android.widget.CursorAdapter.getCount (CursorAdapter.java:132)
android.widget.HeaderViewListAdapter.getCount
(HeaderViewListAdapter.java:132)
android.widget.AdapterView$AdapterDataSetObserver.onChanged
(AdapterView.java:782)
android.database.DataSetObservable.notifyChanged
(DataSetObservable.java:31)
android.widget.BaseAdapter.notifyDataSetChanged (BaseAdapter.java:50)
android.widget.CursorAdapter$MyDataSetObserver.onChanged
(CursorAdapter.java:385)
android.database.DataSetObservable.notifyChanged
(DataSetObservable.java:31)
android.database.AbstractCursor.requery (AbstractCursor.java:97)
android.database.sqlite.SQLiteCursor.requery (SQLiteCursor.java:548)
android.database.CursorWrapper.requery (CursorWrapper.java:211)
android.database.MergeCursor.requery (MergeCursor.java:249)
android.widget.CursorAdapter.onContentChanged (CursorAdapter.java:361)
android.widget.CursorAdapter$ChangeObserver.onChange
(CursorAdapter.java:377)
android.database.ContentObserver$NotificationRunnable.run
(ContentObserver.java:43)
android.os.Handler.handleCallback (Handler.java:587)
android.os.Handler.dispatchMessage (Handler.java:92)
android.os.Looper.loop (Looper.java:123)
android.app.ActivityThread.main (ActivityThread.java:3701)
java.lang.reflect.Method.invokeNative
java.lang.reflect.Method.invoke (Method.java:507)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:866)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:624)
dalvik.system.NativeStart.main

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

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