2012-09-26 216 views
0

我正在做一个Android应用程序。当用户下载应用程序时,我想要将应用程序安装在SD卡中。我可以从开发者方面设置清单中的任何权限,以便当用户下载应用程序时,它可以自动移动到SD卡或要求用户将应用程序移动到SD卡的权限。在这种情况下,任何建议都是有帮助和高度的明显开发人员如何强制应用程序移动到SD卡

感谢inAdvance

+1

你尝试过http://developer.android.com/guide/topics/manifest/manifest-element .html#安装? – sandrstar

回答

9
android:installLocation="preferExternal" 

Youc的添加thjis在manifest.You将有更多的options.This link会帮助你。

+0

感谢....这就是我正在寻找..... –

+0

任何时候我都很开心:-) –

2

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

检查this attribute的Android文档。

“preferExternal”=>应用程序更喜欢安装在外部存储器(SD卡)上的 。系统不会保证 符合此要求。如果外部媒体不可用或已满,或者应用程序使用正向锁定机制(外部存储器不支持 ),则应用程序可能安装在内部 存储器中。安装后,用户可以通过系统设置将应用程序 移至内部或外部存储器。

1

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

0
<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移动到SD卡 这里还有其他的选择也为将来使用..