The Manifest File
The Manifest File
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paad.myapp"
android:versionCode="1"
android:versionName="0.9 Beta"
android:installLocation="preferExternal">
[....manifest nodes....]
</manifest>
1. uses-sdk
It is used to define a minimum and maximum SDK version that must be available on
a device so that our application functions properly, and target SDK for which it has
been designed using a combination of minSdkVersion, maxSdkVersion, and
targetSdkVersion attributes, respectively.
<uses-sdk android:minSdkVersion=”6”
android:targetSdkVersion=”15”/>
2. uses-configuration
The uses-configuration nodes are used to specify the combination of input
mechanisms that are supported by our application. It is useful for games that require
particular input controls.
<uses-configuration android:reqTouchScreen=”finger”
android:reqNavigation=”trackball”
android:reqHardKeyboard=”true”
android:reqKeyboardType=”qwerty”/>
<uses-configuration android:reqTouchScreen=”finger”
android:reqNavigation=”trackball”
android:reqHardKeyboard=”true”
android:reqKeyboardType=”twelvekey”/>
3. uses-features
It is used to specify which hardware features your application requirement.
This will prevent our application from being installed on a device that does not
include a required piece of hardware such as NFC hardware, as follows:
<uses-feature android:name=”android.hardware.nfc”/>
4. supports-screens
It is used to describe the screen support for our application:
<supports-screens
android:smallScreens=”false”
android:normalScreens=”true”
android:largeScreens=”true”
android:xlargeScreens=”true”/>
5. permission
It is used to create permissions to restrict access to shared application
components.
We can also use the existing platform permissions for this purpose or define
your own permissions in the manifest.
<permission
android: name=”com.paad.DETONATE_DEVICE”
android:protectionLevel=“dangerous”
android:label=”Self Destruct”
android:description=”@string/detonate_description”>
</permission>
6. application
A manifest can contain only one application node. It uses attributes to specify
the metadata for your application (including its title, icon, and theme).
During development, we should include a debuggable attribute set to true to
enable debugging, then be sure to disable it for your release builds.
The application node also acts as a container for the Activity, Service, Content
Provider, and Broadcast Receiver nodes that specify the application
components.
The name of our custom application class can be specified using the
android:name attribute.
<application
android:icon="@drawable/icon"
android:logo-"@drawable/logo"
android:theme="@android:style/Theme.Light"
android:name=".MyApplicationClass"
android:debuggable="true">
[....application nodes.....]
</application>