Android2.2中的APK安装到SdCard上
来源:互联网 发布:mac迅雷下载速度慢 编辑:程序博客网 时间:2024/05/22 12:33
1. 首先让你的程序支持SD卡上安装必须具备设置API Level至少为8,即androidmanifest.xml的中android:minSdkVersion至少为8这样你的APK最终运行时兼容的固件只有2.2了,同时在androidmanifest.xml文件的根节点中必须加入android:installLocation这个属性,类似代码如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
... >
2. android:installLocation的值主要有preferExternal、auto和internalOnly这三个选项,通常我们设置为preferExternal可以优先推荐应用安装到SD卡上,当然最终用户可以选择为内部的ROM存储上,如果外部存储已满,Android内部也会安装到内部存储上,auto将会根据存储空间自适应,当然还有一些应用可能会有特殊的目的,他们一般必须安装在内部存储才能可靠运行,设置为internalOnly比较合适,主要体现在:
Services 服务
Your running Service will be killed and will not be restarted when external storage is remounted. You can, however, register for theACTION_EXTERNAL_APPLICATIONS_AVAILABLE broadcast Intent, which will notify your application when applications installed on external storage have become available to the system again. At which time, you can restart your Service. Android123提示大家一般实时后台监控类的应用都应该装到内部存储,比较可靠。
Alarm Services 闹铃提醒服务
Your alarms registered with AlarmManager will be cancelled. You must manually re-register any alarms when external storage is remounted.
Input Method Engines 输入法引擎
Your IME will be replaced by the default IME. When external storage is remounted, the user can open system settings to enable your IME again.
Live Wallpapers 活动壁纸
Your running Live Wallpaper will be replaced by the default Live Wallpaper. When external storage is remounted, the user can select your Live Wallpaper again.
Live Folders 活动文件夹
Your Live Folder will be removed from the home screen. When external storage is remounted, the user can add your Live Folder to the home screen again.
App Widgets Widget
Your App Widget will be removed from the home screen. When external storage is remounted, your App Widget will not be available for the user to select until the system resets the home application (usually not until a system reboot).
Account Managers 账户管理
Your accounts created with AccountManager will disappear until external storage is remounted.
Sync Adapters 同步适配器
Your AbstractThreadedSyncAdapter and all its sync functionality will not work until external storage is remounted.
Device Administrators 设备管理器
Your DeviceAdminReceiver and all its admin capabilities will be disabled, which can have unforeseeable consequences for the device functionality, which may persist after external storage is remounted.
那么哪些应用适合安装在SD卡中呢? Android开发网建议一些占用资源比较大的游戏,比如大于3MB的单个文件,不需要长期驻留内存的应用,不具备提醒和实时监控的应用一般放到SD卡上比较合适,不过目前想让你的应用装到SD卡上,必须设置API Level至少为8以上,同时显示注明android:installLocation。
- Android2.2中的APK安装到SdCard上
- Android2.2中的APK安装到SdCard上
- android 在应用的配置文件设置apk的安装路径,以下是安装到sdcard上的方式
- 获取SDCard上未安装的apk文件的信息
- 在Android模拟器上安装.apk软件,使用管理sdcard
- 应用程序无SDCard安装APK
- APK安装时如何拷贝apk里的文件到sdcard
- APK安装时如何拷贝apk里的文件到sdcard
- android 将Assets中的文件拷贝到sdcard上
- android 将Assets中的文件拷贝到sdcard上
- ANDROID2.2新特性.APK安装参数INSTALLLOCATION
- android 应用安装到SDcard还是内存中的设置
- 批量安装apk到android手机上
- CMD安装APK到设备上
- 用cmd 安装apk到手机上
- 预置APK文件到sdcard下
- 安装APK文件到Android模拟器和Android sdcard的使用
- 双击运行Android模拟器、创建SDcard、AVD、安装APK文件、上传文件到模拟器
- 龙芯pmon常用命令
- rft为什么录制的脚本不能修改?
- android 调用webservice
- css小三角
- UglifyJS在Node.js下的安装
- Android2.2中的APK安装到SdCard上
- 将python3.1+pyqt4打包成exe
- F5负载均衡算法及基本原理
- 备忘录:Nutch+eclipse配置
- 2012,O2O回归正道
- wince驱动-串口分析-mdd,mddcommon,pdd
- linux驱动原载-- touch pannel驱动
- XML应用系列:C#-XSLT开发
- django tutorial 笔记