是否有可能数据库文件复制到SD卡? [英] Is it possible to copy database file to SD card?
问题描述
我有我的Android手机的数据库,我需要得到的信息到SD卡上。
I have a database on my Android phone, and I need to get the information onto an SD card.
是否有可能在数据库文件到SD卡保存在一个可读的状态呢?我一直没能找到有关如何做到这一点的任何信息。
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.
某些源$ C $ c表示数据库文件复制到SD卡将是理想的。
Some source code that copies the database file to an SD card would be ideal.
推荐答案
数据库文件就像任何其他的文件,如果你犯了一个二进制文件复制它的工作。
The database file is just like any other file, if you make a binary file copy it will work.
Java已经没有内置的文件复制方法,所以你可以使用这样的:
Java has no built in file copy method, so you can use this:
<一个href="http://stackoverflow.com/questions/106770/standard-concise-way-to-copy-a-file-in-java/115086#115086">Standard简洁的方式来复制文件中的Java?
只是不要忘记添加您的清单允许写入SD卡:
权限写入SD卡
Just don't forget to add your manifest permission to write to the SD card:
Permission to write to the SD card
这篇关于是否有可能数据库文件复制到SD卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!