Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a database on my Android phone, and I need to get the information onto an SD card.

Is it possible to save the database file onto the SD card in a readable state? I haven't been able to find any information on how to do this.

Some source code that copies the database file to an SD card would be ideal.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
853 views
Welcome To Ask or Share your Answers For Others

1 Answer

The database file is just like any other file, if you make a binary file copy it will work.

Java has no built in file copy method, so you can use this:

Standard concise way to copy a file in Java?

Just don't forget to add your manifest permission to write to the SD card:
Permission to write to the SD card


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...