您的位置:首页 > 移动开发 > Android开发

Android控制应用程序安装位置

2015-04-15 09:49 281 查看
Android控制应用程序安装位置

Android应用程序的默认安装位置以及是否可移动取决于开发者在其AndroidManifest.xml中的设置:
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:installLocation="auto"
android:versionName="1.0">


android:installLocation的值有三个 internalOnly ,auto,preferExternal,缺省值为internalOnly

internalOnly:该应用程序只能安装到手机内部存储中。
auto:由系统决定该应用程序安装到手机内部存储中还是SD卡中。 
preferExternal:如果有SD卡就把该应用程序只能安装到SD卡中,否则安装到手机内部存储中。

当android:installLocation为internalOnly时,用户在"应用程序管理"中不能把应用程序在SD卡与内存中相互移动 

android:installLocation为auto或preferExternal时,用户在"应用程序管理"中可以把应用程序在SD卡与内存中相互移动 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Android 应用程序