[android-developers] Re: database question
Can someone help me? On Oct 20, 5:36 pm, Wouter wouterg...@gmail.com wrote: Hey, I am working on a project for a belgium Tv Guide. Now I download a database (.db) file from a server to the sdcard to work with. In this database are 2 tabels, tvchannels and tvprograms. Now I can do several updates to the tvchannels table and i want to make a backup of this table to a lokal database file. How can i do that? I want to do this because I have to download a new database file every daye from the server and the channels that are choses are saved in the tvchannels database. I want to backup this database table and when the new database file (tvgids.db) is downloaded I want to replace the tvchannels database (from downloaded database file) with the backup from tvchannels.. Anyone has an idea? Thank you, Wouter --~--~-~--~~~---~--~~ 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: database question
Wouter wrote: Now I can do several updates to the tvchannels table and i want to make a backup of this table to a lokal database file. How can i do that? Copy the database file to a backup file. Either you already know your path to your database, or you can use getDatabasePath() to find that path. To be safe, I recommend you have all SQLite* objects and Cursors on that database closed before making the file copy. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books --~--~-~--~~~---~--~~ 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: database question
Hey Mark, Thanks for the answer. So how can i backup that database file? I now have a file tvgids.db on my sdcard (so path is /sdcard/tvgids.db) How can I make a copy of that? Wouter On 23 okt, 19:05, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Now I can do several updates to the tvchannels table and i want to make a backup of this table to a lokal database file. How can i do that? Copy the database file to a backup file. Either you already know your path to your database, or you can use getDatabasePath() to find that path. To be safe, I recommend you have all SQLite* objects and Cursors on that database closed before making the file copy. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android 1.6 Programming Books:http://commonsware.com/books --~--~-~--~~~---~--~~ 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: database question
Wouter wrote: Hey Mark, Thanks for the answer. So how can i backup that database file? I now have a file tvgids.db on my sdcard (so path is /sdcard/tvgids.db) How can I make a copy of that? Java file I/O. http://exampledepot.com/egs/java.io/CopyFile.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books --~--~-~--~~~---~--~~ 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: database question
Nice thank you so much Mark! On Oct 23, 7:56 pm, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Hey Mark, Thanks for the answer. So how can i backup that database file? I now have a file tvgids.db on my sdcard (so path is /sdcard/tvgids.db) How can I make a copy of that? Java file I/O. http://exampledepot.com/egs/java.io/CopyFile.html -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android 1.6 Programming Books:http://commonsware.com/books --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---