gpt4 book ai didi

android - android :installLocation in manifest affect updates as well as fresh installs吗

转载 作者:搜寻专家 更新时间:2023-11-01 08:57:19 25 4
gpt4 key购买 nike

我有两个问题:

1 。 Android list 中的“android:installLocation”标记是否会影响更新和全新安装?

我在市场上发布了一个根本没有“android:installLocation”的应用程序,我正在考虑将以下内容之一添加到 list 中:

android:installLocation="auto"
OR
android:installLocation="preferExternal"

这会影响仅更新其应用的用户吗?他们的应用可以转移到外部存储吗?

我的第二个问题是假设答案是"is"。

2。如果应用程序在更新期间移动,与该应用程序关联的数据是否会受到影响?例如。数据库或共享首选项文件。

documentation说“.apk 文件保存在外部存储中,但所有私有(private)用户数据、数据库、优化的 .dex 文件和提取的 native 代码都保存在内部设备内存中。”

但我担心系统可能会执行完整的卸载/安装循环,而不是正常更新,这会删除数据。这在我的情况下是 Not Acceptable 。

很抱歉,我无法通过实验自己回答这个问题,但是我无法访问任何具有外部存储的设备。希望有人已经完成了上述操作并可以以某种方式确认结果。

额外信息:minSDK = 10targetSDK = 17

感谢您的帮助:

蒂姆

最佳答案

回答你的第一个问题。是的。这将影响现有用户的更新。

But I am worried that instead of the normal update, the system may perform a full uninstall/install cycle which would wipe the data. This is unacceptable in my situation.

只有当您更改签名 key 时才会发生这种情况。它是将您的应用标识为在 Google Play 上独一无二的 key 。

说真的,就此而言,您无需担心。

您的数据将保留在内部存储中。这对安全很重要。

只有当您将数据存储在 SD 卡上并将您的应用程序存储在内部存储器上时,问题才会真正发生。您必须考虑数据可能不可用的事实。但就像我说的。为你的场景。您真的不必担心。

关于android - android :installLocation in manifest affect updates as well as fresh installs吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18107617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com