想要設定ANDROID程式在安裝時要安裝於手機或著額外的SD卡上要去AndroidManifest.xml檔案manifest屬性設定android:installLocation。

android:installLocation

 android:installLocation=["auto" | "internalOnly" | "preferExternal"] 
官方說明





ValueDescription
"internalOnly"The application must be installed on the internal device storage only. If this is set, the application will never be installed on the external storage. If the internal storage is full, then the system will not install the application. This is also the default behavior if you do not define android:installLocation.
"auto"The application may be installed on the external storage, but the system will install the application on the internal storage by default. If the internal storage is full, then the system will install it on the external storage. Once installed, the user can move the application to either internal or external storage through the system settings.
"preferExternal"The application prefers to be installed on the external storage (SD card). There is no guarantee that the system will honor this request. The application might be installed on internal storage if the external media is unavailable or full. Once installed, the user can move the application to either internal or external storage through the system settings.

internalOnly:只能安裝於手機上,安裝完後不能移動。
auto:系統自動判斷,安裝後也可以移動到SD卡上。
preferExternal:存在SD卡上,若是SD卡滿了存在手機上。安裝完後也可以移動到手機上。

官方說明:http://developer.android.com/guide/topics/manifest/manifest-element.html#install

arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()