android APP安裝支持安裝到SDCard
轉自:https://blog.csdn.net/zuolongsnail/article/details/7187375
1.隻有Android2.2及以上版本支持APP安裝到SDCard,也就是說Androidmanifest.xml中的android:minSdkVersion屬性值大於等於8
2.在Androidmanifest.xml的manifest標簽中添加android:installLocation屬性。
- <manifest xmlns:android="https://schemas.android.com/apk/res/android"
- android:installLocation="auto"
android:installLocation的屬性值有三種:
preferExternal表示直接安裝到SDCard,當外部存儲空間不夠時APP會安裝到手機ROM中。
auto表示安裝到手機ROM中,當手機ROM空間不夠時APP會安裝到外部存儲中。
以上兩種方式都可以供用戶在兩種存儲中互相切換。
internalOnly表示隻可以安裝到手機ROM。
最後更新:2017-04-02 17:51:23