是否可以将数据库文件复制到 SD 卡? [英] Is it possible to copy database file to SD card?

查看:34
本文介绍了是否可以将数据库文件复制到 SD 卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 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.

一些将数据库文件复制到 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:

复制文件的标准简洁方式在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆