android install location
2013-01-06 18:13
141 查看
[html] view
plaincopy
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="string"
android:sharedUserId="string"
android:sharedUserLabel="string resource"
android:versionCode="integer"
android:versionName="string"
android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
. . .
</manifest>
The default install location for the application.
The following keyword strings are accepted:
从上图可以看到installLocation属性的取值有三个,用于指示程序安装策略:
1)“auto”:程序默认安装在内存,如果内存空间不足,将安装在外存中;并且之后用户可以通过系统设置随意地在内存和外存之间切换程序的安装位置;
2)“internalOnly”:程序只能安装在内存中,当内存空间不足时,程序将安装失败,当我们不指定installLocation属性时,这是我们程序的默认行为。
3)“preferExternal”:程序优先考虑安装在外存中(SD卡),但当外存空间不足或其他原因影响时,程序也可以被安装在内存中;并且之后用户可以通过系统设置随意地在内存和外存之间切换程序的安装位置;
一般要根据应用的类型来决定应用程序的installLocation取值,以下几种类型的应用不应该安装在外存中(SD卡):
Services、Alarm Services、Input Method Engines、Live Wallpapers、AppWidgets、Account Managers、Sync Adapters、Device Administrators、Broadcast Receivers listening for "boot completed"、Copy Protection。
因此,一般的程序,如果没有特殊要求的话,一般都取值为“auto”。
关于installLocation属性的更多信息可参见:
http://developer.android.com/guide/topics/manifest/manifest-element.html#install
http://developer.android.com/guide/topics/data/install-location.html
plaincopy
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="string"
android:sharedUserId="string"
android:sharedUserLabel="string resource"
android:versionCode="integer"
android:versionName="string"
android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
. . .
</manifest>
android:installLocation
The default install location for the application.
The following keyword strings are accepted:
Value | Description |
---|---|
"internalOnly" | The application must be installed on the internal device storage only. If this is set, the application will never be installed on the external storage. If the internal storage is full, then the system will not install the application. This is also the default behavior if you do not define android:installLocation. |
"auto" | The application may be installed on the external storage, but the system will install the application on the internal storage by default. If the internal storage is full, then the system will install it on the external storage. Once installed, the user can move the application to either internal or external storage through the system settings. |
"preferExternal" | The application prefers to be installed on the external storage (SD card). There is no guarantee that the system will honor this request. The application might be installed on internal storage if the external media is unavailable or full, or if the application uses the forward-locking mechanism (not supported on external storage). Once installed, the user can move the application to either internal or external storage through the system settings. |
1)“auto”:程序默认安装在内存,如果内存空间不足,将安装在外存中;并且之后用户可以通过系统设置随意地在内存和外存之间切换程序的安装位置;
2)“internalOnly”:程序只能安装在内存中,当内存空间不足时,程序将安装失败,当我们不指定installLocation属性时,这是我们程序的默认行为。
3)“preferExternal”:程序优先考虑安装在外存中(SD卡),但当外存空间不足或其他原因影响时,程序也可以被安装在内存中;并且之后用户可以通过系统设置随意地在内存和外存之间切换程序的安装位置;
一般要根据应用的类型来决定应用程序的installLocation取值,以下几种类型的应用不应该安装在外存中(SD卡):
Services、Alarm Services、Input Method Engines、Live Wallpapers、AppWidgets、Account Managers、Sync Adapters、Device Administrators、Broadcast Receivers listening for "boot completed"、Copy Protection。
因此,一般的程序,如果没有特殊要求的话,一般都取值为“auto”。
关于installLocation属性的更多信息可参见:
http://developer.android.com/guide/topics/manifest/manifest-element.html#install
http://developer.android.com/guide/topics/data/install-location.html
相关文章推荐
- 关于:INSTALL_FAILED_DUPLICATE_PERMISSION perm=android.permission.BAIDU_LOCATION_SERVICE pkg=com.exampl
- android之应用程序安装位置application install location
- android-App Install Location
- android:installLocation简析
- Android2.2新特性.APK安装参数installLocation
- android:installLocation
- android install location
- Android 编程下 App Install Location
- android 用户应用使用系统权限如reboot的permission办法 包括顺利安装到手机上INSTALL_FAILED_INVALID_INSTALL_LOCATION
- android:installLocation 设置apk文件默认安装
- AndroidMainfest.xml详解——<android:installLocation&&versionCode&&VersionName&&sharedUserId&&Label/>
- android install location
- App Install Location android应用程序安装位置详解
- Android 编程下 App Install Location
- Android 编程下 App Install Location
- android:installLocation="preferExternal"的意义
- android:installLocation="auto"
- Android开发者指南(7) —— App Install Location
- android:installLocation = "auto" 的用法
- android:installLocation="preferExternal"的意义