0

我正在做一个Android应用程序。当用户下载应用程序时,我希望将应用程序安装在 sd 卡中。我可以从开发人员端在清单中设置任何权限,以便当用户下载应用程序时,它要么自动移动到 sd 卡,要么要求用户允许将应用程序移动到 sd 卡。在这种情况下的任何建议都是有帮助的和高度的可观的

提前致谢

4

4 回答 4

10
    android:installLocation="preferExternal"

您可以在清单中添加 thjis。您将有更多选择。此链接将为您提供帮助。

于 2012-09-26T04:39:44.673 回答
2

您可以android:installLocation="preferExternal"在 AndroidManifest.xml 中设置。

检查 Android 文档以获取此属性

"preferExternal" => 应用程序更喜欢安装在外部存储(SD 卡)上。无法保证系统会遵守此请求。如果外部媒体不可用或已满,或者应用程序使用前向锁定机制(外部存储不支持),则应用程序可能安装在内部存储上。安装后,用户可以通过系统设置将应用程序移动到内部或外部存储。

于 2012-09-26T04:37:03.190 回答
1

android:installLocation="preferExternal"在 AndroidManifest.xml 中。
试试这个它成功地为我工作。

于 2012-09-26T04:45:19.273 回答
1
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="string"
            android:sharedUserId="string"
            android:sharedUserLabel="string resource" 
            android:versionCode="integer"
            android:versionName="string"
            android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
. . </manifest>

使用 preferExternal 移动到 sdcard 这里还有其他选项供将来使用..

于 2012-09-26T05:05:29.497 回答