2012-09-26 49 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卡 這裏還有其他的選擇也爲將來使用..