android应用程序安装位置android:installLocation翻译

来源:互联网 发布:网红拍照软件 编辑:程序博客网 时间:2024/05/22 05:06

前言:

从android API 8开始,可以将应用程序安装在外边存储空间(如设备的SD卡)。这是一个在manifest中的一个可选的属性,即android:installLocation,如果应用程序未声明此属性,应用程序将被安装到内部存储空间上并且不能移动到外部存储空间。

本文如下部分即是对android:installLocation的三种属性的翻译,一方面提高自己的翻译水平,一方面供需要的网友参考。

原文地址:http://developer.android.com/guide/topics/manifest/manifest-element.html

<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>


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.
个人翻译:应用程序必须只被安装在内部设备存储器上。如果设置这个属性,应用程序永远不会被安装在外部存储器上。如果内部存储空间已满,那么系统不会安装这个应用程序。如果没有定义“android:installLocation”这个属性,“internal Only”也是默认值,此时程序会被默认安装在内部设备存储器上。


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. Once installed, the user can move the application to either internal or external storage through the system settings.
个人翻译:应用程序优先安装在外部存储器上(即SD卡)。系统并不一定根据这个属性将应用程序安装在外部存储器上。如果外部存储器不可用或空间已满,那么应用程序就可能安装在内部存储器上。一旦安装,用户可以通过系统设置将应用程序移动到内部或外部存储器上。