Android 上的应用程序到 SD 功能

发布于 2024-09-18 06:32:24 字数 266 浏览 1 评论 0原文

我收到越来越多关于能够使用 App to SD 功能的请求,该功能必须是 Android 2.2 的一部分,但我确实没有这方面的经验。我也不知道在哪里可以找到有关如何使我的应用程序与此功能兼容的任何文档。人们告诉我我的应用程序无法移动到 SD 卡。

我的想法还告诉我,对于没有任何类型的许可证保护的付费应用程序来说,这确实是一个坏主意。

有没有人有这方面的经验,知道任何文档,或者有任何关于什么会阻止应用程序与此功能兼容的提示?

注意:我不在我的应用程序上使用复制保护。

I'm getting more and more requests about being able to use an App to SD feature that must be part of Android 2.2, but I really have no experience with it. I also don't know where to find any documentation regarding how to make my apps compatible with this feature. People have told me my apps cannot be moved to the SD card.

My mind is also telling me that this is a really bad idea for paid apps that don't have license protection of any kind.

Has anyone had any experience with this, know of any documentation, or have any tips regarding what would stop an app from being compatible with this feature?

Note: I do not use copy protection on my apps.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一杯敬自由 2024-09-25 06:32:25

您可以使用 android:installLocation 清单属性允许将您的应用安装到 SD 卡。可以将其设置为 preferExternalauto,具体取决于您是否希望建议将其安装在 SD 卡上,或者只是允许它。默认情况下,出于向后兼容性原因,应用程序无法安装到 SD 卡,因此如果您希望用户能够使用此功能,则必须选择加入此功能。

来自文档

当您的应用程序安装在外部存储上时:

  • 只要设备上安装了外部存储,就不会影响应用程序性能。
  • .apk 文件保存在外部存储上,但所有私有用户数据、数据库、优化的 .dex 文件和提取的本机代码都保存在内部设备内存上。
  • 存储应用程序的唯一容器使用随机生成的密钥进行加密,该密钥只​​能由最初安装它的设备解密。因此,安装在 SD 卡上的应用程序仅适用于一台设备。
  • 用户可以通过系统设置将您的应用移至内部存储。

因此,您不必太担心许可证保护;该功能内置加密功能。您通常也不应该担心许可证保护,因为任何形式的复制保护或 DRM 对诚实用户的危害往往比对盗版用户的危害更大。只要有人能够使用你的应用,就有人能够盗版;创建一个牢不可破的 DRM 方案几乎是不可能的。如果您的应用程序已经在内部存储中,则它可能已经是盗版的。然而,大多数用户都是诚实的,并且会从市场购买应用程序,因此您不会从阻止盗版中真正获得太多收益(大多数下载盗版应用程序的人是那些无法访问市场中付费应用程序的人;这是在许多国家仍然不可用)。

无论如何,结果是,这应该与您的应用程序一样安全,并且只是允许用户在存储应用程序的位置方面具有更大的灵活性。默认情况下不会启用它,以防出现导致应用程序意外崩溃的错误,但启用它应该是完全安全的。

You can allow your app to be installed to the SD card using the android:installLocation manifest attribute. This can be set to preferExternal or auto, depending on whether you would like to recommend that it be installed on the SD card, or simply allow it. By default, applications cannot be installed to the SD card for backwards-compatibility reasons, so you must opt-in to this feature if you want your users to be able to use it.

From the documentation:

When your application is installed on the external storage:

  • There is no effect on the application performance so long as the external storage is mounted on the device.
  • The .apk file is saved on the external storage, but all private user data, databases, optimized .dex files, and extracted native code are saved on the internal device memory.
  • The unique container in which your application is stored is encrypted with a randomly generated key that can be decrypted only by the device that originally installed it. Thus, an application installed on an SD card works for only one device.
  • The user can move your application to the internal storage through the system settings.

Thus, you shouldn't worry about license protection too much; there is encryption built into the feature. You also generally shouldn't worry about license protection because any form of copy protection or DRM tends to be more harmful to honest users than to pirates. As long as someone is able to use your app, someone will be able to pirate it; it is well nigh impossible to create an unbreakable DRM scheme. If your app is already in internal storage, it's likely already pirated. Most users are honest, however, and will buy the app from the Market, so you won't really gain much from stopping piracy (most people who download pirated apps are those who don't have access to paid apps in the Market; it's still not available in many countries).

Anyhow, the upshot is that this should be about as secure as your app already is, and just allows users more flexibility in where to store their app. It's not enabled by default in case of bugs that cause applications that aren't expecting it to break, but it should be perfectly safe to enable.

神仙妹妹 2024-09-25 06:32:25

给你。

并且< a href="http://developer.android.com/guide/topics/manifest/manifest-element.html#install" rel="nofollow noreferrer">记录在此处。

Android 平台现在允许
请求安装的应用程序
到设备的外部存储上
媒体(例如 SD 卡),作为
安装到的替代方案
设备的内部存储器。

应用程序开发人员可以表达
首选安装位置
他们的应用程序通过一个新的
的属性在
清单文件,
android:安装位置。属性
支持三个值:“internalOnly”,
“preferExternal”和“auto”。在
安装时,系统会检查
android:installLocation 的值和
安装应用程序 .apk
根据首选位置,
如果可能的话。如果应用程序有
请求外部安装,
系统将其安装到私有,
外部加密分区
媒体。一旦应用程序 .apk 被
外部安装,系统让
用户更改存储位置
.apk 并将其移动到
设备的内部存储器(如果需要)
(反之亦然),通过管理
用户设置中的应用程序。

系统默认安装所有
应用程序到设备的
内部存储器,除了那些
明确请求外部
安装。这意味着
系统将始终安装旧版本
应用程序到内部存储器,
因为他们无权访问
android:installLocation 属性。
不过,可以配置
并编译一个遗留应用程序,例如
它安装在内部
旧版本的平台和
Android 2.2 及更高版本的外部
如有必要,请使用平台。

请注意,请求安装到
设备的外部媒体不是
适合所有应用,
特别是因为外部
介质可以是可移动的并且
卸载/重新安装可能会破坏
用户体验和系统设置。

有关设置的更多信息
您的首选安装位置
应用程序,包括讨论
应该使用什么类型的应用程序以及
不应请求外部
安装请阅读App
安装位置文档。安装位置文档。

Here you go.

And documented here.

The Android platform now allows
applications to request installation
onto the device's external storage
media (such as the SD card), as an
alternative to installation onto the
device's internal memory.

Application developers can express the
preferred installation location for
their applications by means of a new
attribute of in the
manifest file,
android:installLocation. The attribute
supports three values: "internalOnly",
"preferExternal", and"auto". At
install time, the system checks the
value of android:installLocation and
installs the application .apk
according to the preferred location,
if possible. If the application has
requested external installation, the
system installs it into a private,
encrypted partition in the external
media. Once an application .apk is
installed externally, the system lets
the user change the storage location
of the .apk and move it onto the
device's internal memory if needed
(and vice versa), through Manage
Applications in the user settings.

By default, the system installs all
applications onto the device's
internal memory, except for those that
explicitly request external
installation. This means that the
system will always install legacy
applications onto internal memory,
since they do not have access to
theandroid:installLocation attribute.
However, it is possible to configure
and compile a legacy application such
that it is installed internally on
older versions of the platform and
externally on Android 2.2 and later
platforms, if necessary.

Note that requesting installation onto
the device's external media is not
suitable for all applications,
particularly because the external
media may be removable and
unmounting/remounting may disrupt the
user experience and system settings.

For more information about setting a
preferred install location for your
application, including a discussion of
what types of applications should and
should not request external
installation, please read the App
Install Location document.Install Location document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文