在Android工程中,设置apk的默认安装位置

在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卡,无法接收到开机广播。

本文出自Ray-Ray的博客

文章地址http://www.cnblogs.com/rayray/p/3185811.html

感谢大家的推荐和收藏

你的支持! 我们的动力!

更多相关文章

  1. linearLayout 和 relativeLayout的属性区别
  2. Android(安卓)DNK安装笔记
  3. 关于android SDK安装Failed to fetch URL http://dl-ssl.google.
  4. Androkd开发坏境配置以及常用插件
  5. [摘]android 入门xml布局文件
  6. ANDROID Porting系列一、ANDROID编译系统
  7. android:layout_gravity 和 android:gravity 的区别
  8. Android(安卓)Studio 1.0 苹果电脑安装配置
  9. mac上的android apk安装器

随机推荐

  1. ListView.setOnItemClickListener无效问
  2. 用Eclipse 来导入Android(安卓)工程 总结
  3. WebView在Fragment中点击返回键返回上一
  4. Android布局常用
  5. Android(安卓)Studio 运行模拟器启动失败
  6. Android(安卓)recycleView的研究和探讨
  7. android adb shell 命令大全
  8. ubuntu 安装 android studio
  9. 线性布局LinearLayout和相对布局Relative
  10. Android中的Animation的使用