Android 中设置应用程序安装位置
2014-06-01 02:57
281 查看
转自:http://blog.csdn.net/myshapozi/article/details/6698514
Android 2.2 版本以后,可以支持用户将应用程序安装在 手机内存中还是 SD 卡中。那么,开发者如何设置呢?其实很简单:
在 2.2版本及之后,AndoridManifest.xml 中多一个属性: android:installLocation ,可以设置三个值 ["auto" | "internalOnly" | "preferExternal"]. 分别表示“自动”,“仅仅安装在手机”,“安装在外部SD卡”。
如果你定义了 "preferExternal",意味着你要求你的应用安装至扩展存储,但是系统不能保证应用肯定会安装至扩展存储。如果扩展存储没有空间了,系统将把应用安装到内置存储。用户可以在两个位置之间移动你的应用。
如果你定义了 "auto",表示你的应用可能会安装在扩展存储,但是对安装位置没有特别的偏好。系统将基于很多因素决定你的应用安装到哪里。用户同样可以将应用在两个位置之间移动。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.itcast.life"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="preferExternal"
>
Android 2.2 版本以后,可以支持用户将应用程序安装在 手机内存中还是 SD 卡中。那么,开发者如何设置呢?其实很简单:
在 2.2版本及之后,AndoridManifest.xml 中多一个属性: android:installLocation ,可以设置三个值 ["auto" | "internalOnly" | "preferExternal"]. 分别表示“自动”,“仅仅安装在手机”,“安装在外部SD卡”。
如果你定义了 "preferExternal",意味着你要求你的应用安装至扩展存储,但是系统不能保证应用肯定会安装至扩展存储。如果扩展存储没有空间了,系统将把应用安装到内置存储。用户可以在两个位置之间移动你的应用。
如果你定义了 "auto",表示你的应用可能会安装在扩展存储,但是对安装位置没有特别的偏好。系统将基于很多因素决定你的应用安装到哪里。用户同样可以将应用在两个位置之间移动。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.itcast.life"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="preferExternal"
>
相关文章推荐
- Android 2.2 设置应用程序安装位置
- android应用程序的安装位置
- Android应用程序的安装位置(转)
- Android】Android apk默认安装位置设置
- Android应用程序的安装位置
- android之应用程序安装位置application install location
- Android应用程序的安装位置
- 【Android】Android apk默认安装位置设置
- Android应用程序的安装位置
- Android应用程序的安装位置(一)
- Android应用程序的安装位置
- android如何确认一个应用程序的安装位置
- 【Android】Android apk默认安装位置设置
- Android应用程序的安装位置(二)
- 【Android】Android apk默认安装位置设置
- android 设置程序安装位置
- android修改应用程序默认安装位置和可以选择安装位置
- android通过manifest.xml设置程序安装的位置
- android如何确认一个应用程序的安装位置
- android之应用程序安装位置application install location