Android App--Android apk默认安装位置设置
2014-03-20 13:59
381 查看
在Android工程中,设置apk的默认安装位置
在AndroidManifest.xml文件Manifest标签中添加android:installLocation属性
android:installLocation
这个属性设置的是默认安装位置, 共有三个有效值,auto、internalOnly、preferExternal
对应表
auto 表示自动,由系统决定安装位置
internalOnly 安装在手机内存
preferExternal 安装在外部存储中
需要注意的问题(如果遇到其他问题,后期进行补充)
需要开启启动的程序,一定要安装到手机内存中,这里就关系到广播消息的先后顺序
开机启动的广播消息BOOT_COMPLETE早于 SD的启动,如果将程序安装到SD卡,无法接收到开机广播。
在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 |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ray" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
需要注意的问题(如果遇到其他问题,后期进行补充)
需要开启启动的程序,一定要安装到手机内存中,这里就关系到广播消息的先后顺序
开机启动的广播消息BOOT_COMPLETE早于 SD的启动,如果将程序安装到SD卡,无法接收到开机广播。
相关文章推荐
- Android设备管理器 DevicePolicyManager
- java微信公众账号开发者验证
- Android gzip、base64 加密、解密
- android.graphics.Canvas类详解
- 深入学习JavaScript: apply call方法 详解(转)
- android 仿微信选择相册中的图片跟图片异步加载
- cocos2d-x 用create_project.py创建项目出现SyntaxError: invalid syntax解决方法
- Android设置edittext无边框
- 【android添加jar包】android添加jar包的方法
- 安卓开发第一个小程序HelloWorld
- Android BroadcastReceiver学习总结
- Nagios 监控系统架设全攻略
- Android Wear:智能穿戴催化剂而非原子弹
- MVC
- android service生命周期
- IOS沙盒(sandbox)机制和文件操作
- iOS沙盒(sandbox)机制及获取沙盒路径
- startActivityForResult用法详解
- iOS iPhone 开发中的文件读写及数据存储
- unity3D游戏开发实战原创视频讲座系列2之2D坦克大战开发过程