<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>
<application>
<instrumentation>
<permission>
<permission-group>
<permission-tree>
<uses-configuration>
<uses-permission>
<uses-sdk>
<application>
element
and specify xlmns:android
and package
attributes.xmlns:android
http://schemas.android.com/apk/res/android
".package
To avoid conflicts with other developers, you should use Internet domain ownership as the
basis for your package names (in reverse). For example, applications published by Google start with
com.google
. You should also never use the com.example
namespace when
publishing your applications.
The package name serves as a unique identifier for the application.
It's also the default name for the application process (see the
<application>
element's
process
process attribute) and the default task affinity of an activity
(see the
<activity>
element's
taskAffinity
attribute).
Caution: Once you publish your application, you cannot change the package name. The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version.
android:sharedUserId
android:sharedUserLabel
This attribute was introduced in API Level 3. It is meaningful only if the
sharedUserId
attribute is also set.
android:versionCode
versionName
attribute.
The value must be set as an integer, such as "100". You can define it however you want, as long as each successive version has a higher number. For example, it could be a build number. Or you could translate a version number in "x.y" format to an integer by encoding the "x" and "y" separately in the lower and upper 16 bits. Or you could simply increase the number by one each time a new version is released.
android:versionName
versionCode
attribute holds
the significant version number used internally.
android:installLocation
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. |
Caution: If your application uses the Android Market's Copy Protection feature, it cannot be installed to a device's SD card. However, if you use Android Market's Application Licensing instead, your application can be installed to internal or external storage, including SD cards.
Note: By default, your application will be installed on the
internal storage and cannot be installed on the external storage unless you define this attribute
to be either "auto
" or "preferExternal
".
When an application is installed on the external storage:
.apk
file is saved
to the external storage, but any application data (such as databases) is still saved on
the internal device memory..apk
file is saved is encrypted with a key that allows
the application to operate only on the device that installed it. (A user cannot
transfer the SD card to another device and use applications installed on the card.) Though,
multiple SD cards can be used with the same device.The user may also request to move an application from the internal storage to the external
storage. However, the system will not allow the user to move the application to external storage if
this attribute is set to internalOnly
, which is the default setting.
Read App Install Location for more information about using this attribute (including how to maintain backward compatibility).
Introduced in: API Level 8.
<application>