移动到SD卡 [英] Moving to SD card
问题描述
我知道移至SD卡功能,可从Android 2.2的
我想知道有没有办法在我的程序来检测,如果设备支持移动到SD卡功能,如果它支持可移动否则如果不是比什么都不会发生(会在手机内存中)
I know move to sd card feature is available from android 2.2 I want to know is there way to detect in my program if device supports move to sd card feature, if its supported it can be moved else if not supported than nothing will happen(will be in phone memory)
我的主要问题是我的应用程序支持以上所有设备从1.6到了,我不能使用
My main issue is my app is supporting all devices from 1.6 to above, and i can't use
安卓的installLocation =自动
android:installLocation="auto"
,因为它不认可低于2.2版。所以,做我必须做的检查,使编程如果又如何?我希望你明白我的问题。
because its not recognized for below version 2.2 . So do i have to do checking and enabling programmatically and if so how ? I hope you understand my problem.
感谢。
推荐答案
要允许外部存储设备,并保持比API级别低8版本兼容的:
To allow installation on external storage and remain compatible with versions lower than API Level 8:
-
包含
的android:以
属性$ C> preferExternal 中的汽车
或<$ C值的installLocation&LT;表现方式&gt;
元素
留下你的的android:由于是的minSdkVersion
属性(东西小于8),并确定应用程序code只使用API的兼容这一水平。
Leave your android:minSdkVersion
attribute as is (something less than "8") and be certain that your application code uses only APIs compatible with that level.
为了编译你的应用程序,更改您的构建目标API级别8,因为较旧的Android库不懂的android这是必要的:的installLocation
属性并不会编译应用程序时,它的present。
In order to compile your application, change your build target to API Level 8. This is necessary because older Android libraries don't understand the android:installLocation
attribute and will not compile your application when it's present.
当您的应用程序安装在设备上的API级别低于8,的android:的installLocation
属性被忽略,并且应用程序被安装在内部存储
When your application is installed on a device with an API Level lower than 8, the android:installLocation
attribute is ignored and the application is installed on the internal storage.
这是Android的向后兼容性说。
This is what Android's Backward Compatibility Says.
另请参阅应用程序不应该在外部存储安装
和,应该在外部存储安装应用程序
Also refer Applications That Should NOT Install on External Storage and Applications That Should Install on External Storage
这篇关于移动到SD卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!