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. [Share] Androski ... Android Mini Figure Asli Korea

Cakep yah...

Oxygen 2.0 RC6


bagus...
ebay

-- 
===============

2. [Share] Quote tentang Android Market

Mau ngeshare gambar aja nih..

"If you can dream it, you can get it." ( sumber gambar: http://bit.ly/fhb7mr)
Emang ya di Android Market segala macem aplikasi ada, dari yang penting
sampe ga penting, haha :D

-- 
Ibnu Sina
just call me Ibun
twitter: @iboen

http://bit.ly/anw5Yz

-- 
===============

<<attachment: market.png>>

3. [WTS] Samsung Galaxy S i9000 16Gb VIRGIN!!!

4. [WTS] 2 gadget android 2nd

5. Wtt: n900 sama incredi

6. Listview crash during orientation change

7. Can an app read another app's apk?