[android-developers] Re: What is the best way to backup app database to a file?

2009-09-20 Thread Moto
When doing: //open your existing DB InputStream dbStream = mContext.getAssets().open(yourDBName); I'm not able to start reading... Do I need a particular permission type? Also, when writing back to that location a new database which permission should be set? Thanks, -Moto! On Sep 8, 12:37 

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-20 Thread Moto
I take that back... It actually works without any permission as it should... File f1 = ctx.getDatabasePath(appDatabase.db); InputStream in = new FileInputStream(f1); -Jona On Sep 20, 2:19 pm, Moto medicalsou...@gmail.com wrote: When doing: //open your existing DB InputStream dbStream =

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-20 Thread Moto
I take that back... It actually works without any permission as it should... File f1 = ctx.getDatabasePath(appDatabase.db); InputStream in = new FileInputStream(f1); - Moto! On Sep 20, 2:19 pm, Moto medicalsou...@gmail.com wrote: When doing: //open your existing DB InputStream dbStream =

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-08 Thread Moto
Perfect! I really appreciate everyone's help! -Moto! On Sep 8, 1:05 am, mjc147 westmead...@yahoo.co.uk wrote: On Sep 7, 3:30 am, Mark Murphy mmur...@commonsware.com wrote: Now, the database path location may change in future Android releases, and I am not aware of a place in the API to

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-07 Thread mjc147
On Sep 7, 3:30 am, Mark Murphy mmur...@commonsware.com wrote: Now, the database path location may change in future Android releases, and I am not aware of a place in the API to get the path to a database in a more official fashion. You can use the Context.getDatabasePath() method:

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-06 Thread Mark Murphy
Moto 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? One approach is to copy the database file. Tactically, new File(getFilesDir(), ../databases) is the directory where your database file

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-06 Thread Moto
So, I can actually access the database as a file copy and than restore it by moving it to the same location where it was copied from? Thanks! On Sep 6, 3:30 pm, Mark Murphy mmur...@commonsware.com wrote: Moto wrote: I need to somehow backup my applitcations database to a file so that it

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-06 Thread Mark Murphy
Moto wrote: So, I can actually access the database as a file copy and than restore it by moving it to the same location where it was copied from? AFAIK, it should work fine, so long as it is your app doing the copying, and you are not trying to use the database while copying (in either

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-06 Thread Moto
Great this will be perfect! Thanks Mark! --~--~-~--~~~---~--~~ 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

[android-developers] Re: What is the best way to backup app database to a file?

2009-09-06 Thread Roman ( T-Mobile USA)
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