android APP安装支持安装到SDCard

转自:http://blog.csdn.net/zuolongsnail/article/details/7187375


1.只有Android2.2及以上版本支持APP安装到SDCard,也就是说Androidmanifest.xml中的android:minSdkVersion属性值大于等于8


2.在Androidmanifest.xml的manifest标签中添加android:installLocation属性。

[html]  view plain copy
  1. <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     android:installLocation="auto"  

android:installLocation的属性值有三种:

preferExternal表示直接安装到SDCard,当外部存储空间不够时APP会安装到手机ROM中。

auto表示安装到手机ROM中,当手机ROM空间不够时APP会安装到外部存储中。

以上两种方式都可以供用户在两种存储中互相切换。

internalOnly表示只可以安装到手机ROM。


你可能感兴趣的:(html,android,存储,手机)