Are you right now thinking only to backup your data base on the device
or also somewhere on a remote location (PC, server)?

You could easily do a byte copy of your DB

        //open your existing DB
        InputStream dbStream = mContext.getAssets().open(<yourDBName>);

        OutputStream backupDbStream = new FileOutputStream(<path+name of
your backup DB>);

        //copy file from your existing DB to your backup DB
        byte[] buffer = new byte[1024];
        int length;
        while ((length = dbStream.read(buffer))>0){
                backupDbStream.write(buffer, 0, length);
        }


If you want to support backing up the DB on a remote system, you could
easily use the same mechanism.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




On Sep 6, 12:22 pm, Moto <[email protected]> wrote:
> I need to somehow backup my applitcations database to a file so that
> it can later be retored using that file.  Any suggestions to doing
> this?
>
> The only way I would do it would be by reading every table to an xml
> ffile but it seems soo ineficient...  The data does not have to be
> humand readable...
>
> Thanks!
> -Moto!
--~--~---------~--~----~------------~-------~--~----~
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