Android】Android apk默認安裝位置設置

在Android工程中,設置apk的默認安裝位置


在AndroidManifest.xml文件Manifest標籤中添加android:installLocation屬性

android:installLocation

這個屬性設置的是默認安裝位置, 共有三個有效值,auto、internalOnly、preferExternal

對應表

auto 表示自動,由系統決定安裝位置

internalOnly 安裝在手機內存

preferExternal 安裝在外部存儲中

ConstantValueDescription
auto0Let the system decide install location
internalOnly1Explicitly request to be installed on internal phone storage only
preferExternal2Perfer to be installed on SD card, There is no guarantee that the system will honor this request. The application might end up being installed on internal storage if external media is unavailable or too full


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.ray"
      android:installLocation="auto"
      android:versionCode="1"
      android:versionName="1.0">


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章