手机华为怎么把应用移到内存卡不到内存卡 m.tongxiehui.net

8603人阅读
【Android基础】(79)
我们在使用Android手机时发现,有的程序允许被移动到SD卡,而有的不行?这是为什么呢?
因为在Android 2.2版之后, Android应用才被允许移动到SD卡中。而在此之前开发的应用,全部没有这个功能。
那么究竟如何允许你的应用移动到SD卡呢?答案其实很简单,只要给Manifest设置一个installLocation属性即可。
这个属性设置的是默认安装位置, 共有三个有效值,auto、internalOnly、preferExternal。
表示自动,由系统决定安装位置
internalOnly
安装在手机内存
preferExternal
安装在外部存储中
看一下修改后的AndroidManifest.xml。
&manifest xmlns:android=&/apk/res/android&
package=&com.yfz&
android:installLocation=&auto&
android:versionCode=&1&
android:versionName=&1.0&&
是不是很简单?
可能有人会问,如果我的还要支持2.1怎么办呢? 其实不用管啦,你只要设置&&&uses-sdk android:minSdkVersion=&7& /& 然后安装到2.1的设备上时,Android会忽略这个属性,直接给你安装到手机内存。
需要额外注意的是,并不是所有程序都适合移到SD卡上。下面就看一下,在哪些条件下,不建议允许程序移动到SD卡上。
Applications That Should NOT Install on External Storage
When the user enables USB mass storage to share files with their computer (or otherwise unmounts or removes the external storage), any application installed on the external storage and currently running is killed. The system effectively becomes unaware of the application until mass storage is disabled and the external storage is remounted on the device. Besides killing the application and making it unavailable to the user, this can break some types of applications in a more serious way. In order for your application to consistently behave as expected, you should not allow your application to be installed on the external storage if it uses any of the following features, due to the cited consequences when the external storage is unmounted:
Your running Service will be killed and will not be restarted when external storage is remounted. You can, however, register for the ACTION_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.
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
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.
Broadcast Receivers listening for &boot completed&
The system delivers the ACTION_BOOT_COMPLETED broadcast before the external storage is mounted to the device. If your application is installed on the external storage, it can never receive this broadcast.
Copy Protection
Your application cannot be installed to a device's SD card if it uses Android Market's Copy Protection feature. However, if you use Android Market's Application Licensing instead, your application can be installed to internal or external storage, including SD cards.
If your application uses any of the features listed above, you should not allow your application to install on external storage. By default, the system will not allow your application to install on the external storage, so you don't need to worry about your existing applications. However, if you're certain that your application should never be installed on the external storage, then you should make this clear by declaring android:installLocation with a value of &internalOnly&. Though this does not change the default behavior, it explicitly states that your application should only be installed on the internal storage and serves as a reminder to you and other developers that this decision has been made
上面这段一定要看,很重要。 比如你的程序如果想开机自启动,那就一定不能允许移动到SD卡了。 因为开机启动的广播消息BOOT_COMPLETE在 SD 卡被装载之前就发出来了,程序根本没法收到。
好了,就写这么多了。
更多内容可以看这里: &
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:2194960次
积分:16098
积分:16098
排名:第403名
原创:134篇
转载:56篇
评论:785条平板/笔记本
荣耀4a将应用软件移动到SD卡出现问题
&初窥门径&
来自:浏览器
应用软件移动到SD卡,系统提示SD卡存储已满,然后所有之前移动到SD卡的软件都没有了,求解释
width:100%">
&登堂入室&
来自:浏览器
我遇到过关机,拿出sd卡后再放进去时移动到sd卡的程序丢失。
width:100%">
&渐入佳境&
来自:浏览器
还有安全管家里面,也看不到SD卡应用流量控制
width:100%">
&登堂入室&
来自:浏览器
ad_min_ 发表于
还有安全管家里面,也看不到SD卡应用流量控制
升级后出现的问题,期待尽快出更新,解决此问题,用起来非这个常不方便。
width:100%">
&自成一派&
来自:浏览器
你的SD卡是不是有问题,另外4A不支持热插拔SD卡,请在关机后再插拔SD卡,推荐使用闪迪的SD卡。
width:100%">
&禁止发言&
来自:浏览器
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
width:100%">
&初窥门径&
来自:浏览器
sd卡没问题,我也觉得可能是升级了系统后出现的问题
width:100%">
&炉火纯青&
来自:浏览器
这个不好说啊
width:100%">
&新学乍练&
来自:浏览器
暗夜丶猎手 发表于
你的SD卡是不是有问题,另外4A不支持热插拔SD卡,请在关机后再插拔SD卡,推荐使用闪迪的SD卡。 ...
就是闪迪的内存卡,不懂为什么移动不了,显示移动应用无法移动
width:100%">
&禁止发言&
来自:浏览器
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
width:100%">
1000万花粉
纪念花粉俱乐部注册花粉数超过1000万
【九龙江夕阳】【小胖子】【谁持彩练当空舞】【乌云翻墨未遮天】【赛里木湖】【风和日丽游古城】
花粉客户端
Make it Possible
Make your device special
华为云服务
Huawei cloud services
音乐播放器
Huawei Music
Huawei Vmall
没有最新动态
关注花粉俱乐部
联系我们:
|关注花粉俱乐部:
Copyright (C)
华为软件技术有限公司 版权所有 保留一切权利经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
今天拿到红米手机,上了内存卡,安装了一些软件。可是当我查看安装软件位置的时候,全都在手机内存里面,而且没有办法移动到内存卡里面,360的软件搬家也试过了,还是不行。本身手机内存就只有2G左右,这样下去担心手机内存严重不够用啊!有没有哪位高手知道这是怎么回事?有没有解决方法啊?
分享到微信朋友圈
打开微信,点击底部的“发现”,使用 “扫一扫” 即可将网页分享到我的朋友圈。
经验223 米
在线时间21 小时
版本JLB54.0
积分 255, 距离下一级还需 245 积分
积分 255, 距离下一级还需 245 积分
机型小米手机2/2S
签到次数18
MIUI版本JLB54.0
这个问题很大,都没人出来解决的,这就是红米的软肋,没装几个软件就老是提示内存不足
经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
就是啊!我都发帖一天了,还是没有人来解答啊!晕死。。。。。
经验10108 米
威望246 米
在线时间1061 小时
版本4.12.5
小米八工程测试版
积分 15420, 距离下一级还需 4580 积分
积分 15420, 距离下一级还需 4580 积分
机型小米手机2A
签到次数96
MIUI版本4.12.5
软件都有默认安装位置,强行移动会导致程序异常,崩溃,死机,等问题!
经验10970 米
在线时间1300 小时
版本V7.2.5.0.LXACNDA
手环环中环
积分 13800, 距离下一级还需 6200 积分
积分 13800, 距离下一级还需 6200 积分
机型小米手机3/4 WCDMA国际版
签到次数96
MIUI版本V7.2.5.0.LXACNDA
路过学习下
经验133 米
在线时间13 小时
版本HBJ2.1
积分 167, 距离下一级还需 33 积分
积分 167, 距离下一级还需 33 积分
机型红米手机 TD版
MIUI版本HBJ2.1
这还不是最蛋疼的,最蛋疼的是程序数据包、照片视频等都放在一个不足800M的空间中,开发人员怎么想的?
经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
就是就是!!!太蛋疼了。。。。。。
经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
可是这样的话软件安装的总内存只有800多M啊,完全不够用啊!!!!!!!!!!!
经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
& &这个问题已经解决了,你去这个帖子看一下吧,我现在已经弄好了
经验1547 米
在线时间74 小时
版本V7.1.4.0.LXKCNCK
积分 1665, 距离下一级还需 335 积分
积分 1665, 距离下一级还需 335 积分
机型小米手机4c
签到次数108
MIUI版本V7.1.4.0.LXKCNCK
问题已经解决了去这个帖子看看吧
MIUI 2000万
MIUI 2000万发烧友纪念勋章
MIUI三周年
MIUI三周年纪念勋章
已关注微信
关注腾讯微博
已关注腾讯微博
关注新浪微博
已关注新浪微博
MIUI 3000万
MIUI 3000万发烧友纪念勋章
1000万用户纪念勋章
MIUI1000万用户纪念勋章
MIUI五周年
MIUI五周年纪念勋章
小米平板首发纪念勋章
小米平板首发纪念勋章
小米手机3终身荣誉勋章
小米手机3终身荣誉勋章
百万壁纸评审纪念勋章
已关注极客秀微信
MIUI俱乐部发烧友
MIUI俱乐部发烧友
MIUI 7纪念勋章
小米手机元器件合体活动勋章
小米求合体勋章
Copyright (C) 2016 MIUI
京ICP备号 | 京公网安备34号 | 京ICP证110507号}

我要回帖

更多关于 把软件移到sd卡 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信