database question

by Wouter » Tue, 20 Oct 2009 23:37:39 GMT


Sponsored Links
 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
--~--~---------~--~----~------------~-------~--~----~



database question

by Wouter » Sat, 24 Oct 2009 00:50:29 GMT


 Can someone help me?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


database question

by Mark Murphy » Sat, 24 Oct 2009 01:07:16 GMT


 


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 

--~--~---------~--~----~------------~-------~--~----~



database question

by Wouter » Sat, 24 Oct 2009 01:18:07 GMT


 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





--~--~---------~--~----~------------~-------~--~----~



database question

by Mark Murphy » Sat, 24 Oct 2009 01:57:54 GMT


 


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 

--~--~---------~--~----~------------~-------~--~----~



database question

by Wouter » Sat, 24 Oct 2009 02:04:21 GMT


 Nice thank you so much Mark!





--~--~---------~--~----~------------~-------~--~----~



Database question

by mh » Fri, 20 Nov 2009 14:55:41 GMT


 I am developing on a MyTouch.  When I run the example Notepad
application data is saved but I don't see anything in the data
directory when browsing with AndExplorer.

1) Is root required to see the data files in a directory listing?

2) Is there a device facility available for a typical non-root user to
remove no longer necessary databases?   Or is the application
responsible for managing all aspects of an associated database?

Thanks

--



Other Threads

1. Akhirnya....CM5 for Dream/Magic -> yup, its Eclair!!!

Hajaaaarrr

@lutfihidayatr
im not a google defender but i always love google innovation




@cyanogen: CyanogenMod-5.0.7-test1 for Dream & Magic! EXPERIMENTAL!
http://bit.ly/ab9PZZ  (XDA: http://bit.ly/aBaaXf) #android #teamdouche

--
"Indonesian Android Community [id-android]"

2. install gogle maps

mau tanya gimncara reinstall gmaps. punya saya mendadak ilang

tks
dilar

-- 
"Indonesian Android Community [id-android]" 

3. Music player yg ada equalisernya

4. Forum xda on market

5. : Send and Receive business card (vcard) contact di Spic

6. (WTA) About Babbler

7. Need Help Upgrade Galaxy Spica to Eclair 2.