【问题标题】:Does Android do data backup automatically in the case no backup requests?在没有备份请求的情况下,Android 是否会自动进行数据备份?
【发布时间】:2014-11-07 19:54:58
【问题描述】:

我正在编写我的第一个使用本地 Sqlite 数据库的 Android 应用程序。我想在 Google 云上实现数据库备份,以便 Android 可以在最终用户重新安装应用程序时恢复数据库。

据我了解。每当数据发生变化时,开发者都需要调用“BackupManager.dataChanged()”来请求备份。

我的问题是:如果开发人员在数据更改时不调用“BackupManager.dataChanged()”会怎样?即使开发者没有请求备份,Android 是否会自动/定期进行备份?

谢谢!

【问题讨论】:

    标签: android backup database-backups android-backup-service


    【解决方案1】:

    我读了这篇文章并得出结论,“要进行备份”,必须调用 dataChanged() :

     "Each time that your application data changes and you want to perform a backup, 
     you must request a backup operation by calling dataChanged()."
    

    重新安装应用程序时,恢复过程是自动的。

    "Android automatically performs a restore operation when your application is 
    installed and there exists backup data associated with the user." 
    

    这两个句子都是来自此链接的“复制粘贴”:http://developer.android.com/guide/topics/data/backup.html

    【讨论】:

    • 谢谢!我以前读过这个页面,但仍然提出了这个问题。我想你是对的。
    猜你喜欢
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-10
    • 1970-01-01
    相关资源
    最近更新 更多