【问题标题】:Xamarin - How to upgrade Android app and keep files under android data folderXamarin - 如何升级 Android 应用程序并将文件保存在 android 数据文件夹下
【发布时间】:2017-05-24 09:18:22
【问题描述】:

我需要部署使用 Xamarin 制作的 Android 应用的新版本。我的应用程序将文件存储在以下路径中:

android > 数据 > APP.PACKAGE_NAME > 文件 > 数据

问题是这些文件在升级后被擦除,应用程序需要与远程服务器重新同步,这是正常现象还是我遗漏了什么?

我要做的是升级属性> Android Manifest中的版本号,然后存档并在我的设备上部署生成的apk。

【问题讨论】:

  • 您如何将新的 apk“部署”到您的设备上?如果您正在执行卸载/安装,那么是的,您的数据将被删除,如果您使用的是adb, make sure your are using -r` 标志:adb install -r .....
  • 我要做的是:我将使用 Visual Studio 生成的 apk 复制到设备的 SD 卡上,然后在文件资源管理器中手动启动安装,这似乎会删除文件

标签: xamarin xamarin.android apk


【解决方案1】:

如果您的设备已植根,则可能是您的问题的原因。

Database (Sqlite-net) do not persist between build on Monodroid

The device was somewhat rooted (or not). I have read somewhere that this might be an issue so I followed these steps:

1. Installed KingoRoot
2. Device "was already rooted" (broken), but rooted it with KingoRoot, then crashed
3. Tried to root it again with success
4. UnRooted the device with SuperUser
5. Uninstalled KingoRoot
6. Now data is preserved when compiling/debugging to the device.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-21
    • 1970-01-01
    相关资源
    最近更新 更多