如何备份和恢复的应用程序的数据库的数据? [英] how to backup and restore data of an applications database?

查看:155
本文介绍了如何备份和恢复的应用程序的数据库的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,它会做应用程序的数据库到谷歌服务器的备份和重新安装应用程序后恢复数据。

I'm developing an application which will do the backup of Application's database to the Google servers and restore the data after reinstalling the application.

我没有找到任何引用做这个任务。我还可以,但不是通过运行应用程序尝试在Android的SDK,它与shell命令只工作给应用程序。

I didn't find any reference to do this task. I also tried the application given in Android SDK, which is working only with the Shell commands, but not by running the application.

可能有人是有一个想法如何做备份和应用程序的数据库中的数据恢复?

Could anybody is having an idea how to do the backup and restore of the Application's database data?

推荐答案

的SQLite的备份API的工作只有在备份是可以直接访问另一个文件(例如,如果你要创建的SD卡上的备份)所以它不能在备份云入云。

SQLite's backup API works only where the backup is another file that can be accessed directly (for example, if you want to create a backup on the SD card), so it cannot be used when the backup goes "into the cloud".

确保没有活动的事务,然后备份数据库文件,就像你备份的任何其他文件。

Ensure that there is no active transaction, then backup the database file just as you would backup any other file.

这篇关于如何备份和恢复的应用程序的数据库的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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