我收到越来越多关于能够使用应用程序到 SD 功能的请求,该功能必须是 Android 2.2 的一部分,但我真的没有这方面的经验。我也不知道在哪里可以找到有关如何使我的应用程序与此功能兼容的文档。人们告诉我我的应用程序无法移动到 SD 卡。
我的想法还告诉我,对于没有任何许可保护的付费应用程序来说,这是一个非常糟糕的主意。
有没有人对此有任何经验、了解任何文档,或者对什么会阻止应用与此功能兼容有任何提示?
注意:我没有对我的应用程序使用版权保护。
最佳答案
您可以使用 android:installLocation
list 属性将您的应用程序安装到 SD 卡。这可以设置为 preferExternal
或 auto
,具体取决于您是建议将其安装在 SD 卡上,还是只是允许它。默认情况下,出于向后兼容性原因,无法将应用程序安装到 SD 卡,因此如果您希望用户能够使用该功能,则必须选择加入此功能。
来自 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.
因此,您不必过分担心许可证保护;该功能内置了加密功能。您通常也不应担心许可证保护,因为任何形式的版权保护或 DRM 对诚实用户的危害往往比对盗版者的危害更大。只要有人能用你的应用,就有人能盗版;几乎不可能创建牢不可破的 DRM 方案。如果您的应用程序已在内部存储中,则它可能已经被盗版。然而,大多数用户是诚实的,并且会从 Market 购买应用程序,因此您不会从阻止盗版中真正获益(大多数下载盗版应用程序的人是那些无法访问 Market 中的付费应用程序的人;它是在许多国家仍不可用)。
无论如何,结果是这应该与您的应用程序一样安全,并且只允许用户更灵活地存储他们的应用程序。默认情况下不会启用它,以防出现错误导致应用程序不希望它中断,但启用它应该是绝对安全的。
关于android - Android 上的应用程序到 SD 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3687413/