将程序装到sdcard上

 

在androidmainfest.xml中加入属性android:installLocation,它的值可以有3个选项

    • internalOnly: Install the application on internal storage only. This will result in storage errors if the device runs low on internal storage.(非sdcard)
    • preferExternal: The android system tries to install the application on external storage. If that is full, the application is installed on internal storage.(在sdcard未满的情况下装在sdcard)
    • auto: Let the Android system decide the best install location for the application. The default system policy is to install the application on internal storage first. If the system is running low on storage, the application is then installed on external storage.(自主选择,内部存储有限,内部存储低的时候使用外部存储)

这个属性的api level为8,2.2的手机才可以将程序装入sdcard,这样可以尽可能的多装程序,此外,只有再程序的sdk2.2的情况下才可以编译通过,找了半天没找到代码中的对应的java code,看来我的2.1一定要升级了。

 

参考: http://devicefms.ro/installmove-to-sd-card-on-froyo.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值