[android-developers] Re: backup database

2009-03-23 Thread Mark Murphy

daniel.benedykt wrote:
 Is there a standard way to backup the database of my app.

Standard? No.

 I know I can write data to a file from the DB and restore it at any
 time with my code, but what happens if for some reason the user loose
 all the data on the phone. Is there a way to make a backup to a
 computer?

You should have access to the database file, so you can transfer it via
whatever mechanism you like (e.g., HTTP) to whatever destination you can
reach via the Internet. I would make sure you do not have any active
SQLiteDatabase objects referencing it, though.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Warescription: Three Android Books, Plus Updates, $35/Year

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



[android-developers] Re: backup database

2009-03-23 Thread daniel.benedykt

Thanks Mark.
ok, transfer to some other place is a good idea.

Is there any way to Sync files or XML with Google SYNC from the phone?

Thanks

On Mar 23, 6:28 pm, Mark Murphy mmur...@commonsware.com wrote:
 daniel.benedyktwrote:
  Is there a standard way to backup the database of my app.

 Standard? No.

  I know I can write data to a file from the DB and restore it at any
  time with my code, but what happens if for some reason the user loose
  all the data on the phone. Is there a way to make a backup to a
  computer?

 You should have access to the database file, so you can transfer it via
 whatever mechanism you like (e.g., HTTP) to whatever destination you can
 reach via the Internet. I would make sure you do not have any active
 SQLiteDatabase objects referencing it, though.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---