应用程序的安装位置想必大家都不陌生,要么安装在手机内存里,要么安装在SD卡里。

那么该如何配置应用程序的安装位置呢,,没错,非常简单,就是在AndroidManifest.xml文件里配置,只需要在<manifest >里添加android:installLocation这个属性就可以了。如下:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.example.called"    android:versionCode="1"    android:versionName="1.0"     android:installLocation="preferExternal"    ..........
这个属性共有三个值 “ preferExternal” ," auto" 以及 " internalOnly",那么他们各自代表什么意思呢?

internalOnly :程序只能安装在手机内存中,如果手机内存已满,则程序无法安装。这也是系统默认选项,即如果不设置android:installLocation这个属性,系统会默认设置为internalOnly。

auto : 程序优先选择在手机内存中安装,但如果手机内存已满,则程序会安装到SD卡中。程序安装好之后,用户还可以在手机设置里移动应用程序的位置。

preferExternal : 程序优先选择安装在SD卡中,但如果SD卡内存已满或者不支持安装此程序,系统会将此程序安装到手机内存里。应用程序安装好之后,用户也能通过手机设置移动应用程序的位置。


关于哪些应用程序应该安装在手机内存里,哪些应用程序不适合安装在SD卡里,等详细问题,请访问这个网页(需fangqiang) :http://developer.android.com/guide/topics/data/install-location.html 。我就不翻译了。

更多相关文章

  1. Android打开系统设置界面
  2. property_get/property_set
  3. Android核心模块内容概述
  4. Android(安卓)O 8.0 新功能预览
  5. 修改Android手机的“虚拟机堆大小”和android:largeHeap来防止AP
  6. [入门四]Android核心模块及相关技术
  7. Android核心模块及相关技术
  8. 手机操作系统开源软件
  9. android 的多任务之道(个人渣水平,无责任翻译)(目前到Design con

随机推荐

  1. 自定义ViewGroup onMeasure onLayout
  2. Android几种定时器的使用
  3. 7.高级UI组件
  4. 漂亮的Android加载动画
  5. android 7.0 user版本调试方法
  6. android SharePreference适用任何基本类
  7. 802.11(wifi)中SSID、BSSID、ESSID的区别
  8. com.android.cts.devicepolicy.ManagedPr
  9. android 扫描sdcard下的图片
  10. RF Analyzer for Android(安卓)安卓平台