在Android工程中,设置apk的默认安装位置
在AndroidManifest.xml文件Manifest标签中添加android:installLocation属性
android:installLocation
这个属性设置的是默认安装位置, 共有三个有效值,auto、internalOnly、preferExternal
对应表
auto 表示自动,由系统决定安装位置
internalOnly 安装在手机内存
preferExternal 安装在外部存储中
Constant | Value | Description |
auto | 0 | Let the system decide install location |
internalOnly | 1 | Explicitly request to be installed on internal phone storage only |
preferExternal | 2 | Perfer 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 |