Xamarin - 如何升级 Android 应用程序并将文件保存在 android 数据文件夹下 [英] Xamarin - How to upgrade Android app and keep files under android data folder

查看:36
本文介绍了Xamarin - 如何升级 Android 应用程序并将文件保存在 android 数据文件夹下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to deploy a new version of my Android app made with Xamarin. My app stores files in the following path:

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

android > data > APP.PACKAGE_NAME > files > data

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

The problem is those files are wiped after the upgrade and the app needs to resync with the remote server, is this behavior normal or am I missing something ?

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

What I do is upgrade the version number in the properties > Android Manifest, then Archive and deploy the generated apk on my device.

推荐答案

如果您的设备已 root,则可能是导致问题的原因.

If your device is rooted, it can be the cause of your problem.

数据库 (Sqlite-net) 在 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.

这篇关于Xamarin - 如何升级 Android 应用程序并将文件保存在 android 数据文件夹下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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