閱讀484 返回首頁    go 微軟 go windows


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屬性。

[html] view plaincopy
  1. <manifest xmlns:android="https://schemas.android.com/apk/res/android"  
  2.     android:installLocation="auto"  

android:installLocation的屬性值有三種:

preferExternal表示直接安裝到SDCard,當外部存儲空間不夠時APP會安裝到手機ROM中。

auto表示安裝到手機ROM中,當手機ROM空間不夠時APP會安裝到外部存儲中。

以上兩種方式都可以供用戶在兩種存儲中互相切換。

internalOnly表示隻可以安裝到手機ROM。


最後更新:2017-04-02 17:51:23

  上一篇:go 百度2012暑期實習麵經(自動化平台研發)
  下一篇:go android listview 設置點擊效果selector