如何备份数据库文件到SD卡上的android? [英] How to backup database file to sdcard on android?

查看:124
本文介绍了如何备份数据库文件到SD卡上的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个功能添加到我的Andr​​oid应用程序,自动SQLite数据库备份到SD卡上。

I'd like to add a feature to my android app that automatically backs up the sqlite database to the sd card.

什么是去了解这一点的最好方法是什么? 任何例子/提供教程?

What's the best way to go about this? Any examples/tutorials available?

推荐答案

SQLite数据库是完全独立的文件,是便携式—你可以将整个文件只是复制直接到SD卡上。

SQLite databases are completely self-contained files and are portable — you can just copy the entire file straight to the SD card.

虽然一开始我会检查是否被安装在该设备的SD卡,以及其路径(使用 Environment.getExternalStorageDirectory())。

Though first I'd check whether an SD card is installed in the device, and what its path is (using Environment.getExternalStorageDirectory()).

这篇关于如何备份数据库文件到SD卡上的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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