Friday, February 19, 2010

AndroidManifest.xml : Demystified..

Just like every living being has a soul..every Android application has an ‘AndroidManifest.xml’.

Like the soul, it tells about the application and it various properties like the permissions it uses, activities it has, minimum version of the SDK required etc. Below is an example to demonstrate the content in an androidmanifest.xml file:-

androidmanifest.xml file image

As shown in the above example, every ‘androidmanifest’ file has the following structure:

:It’s the root element. And all the elements are described as the child to this element. It also tell us about the java package for the application.

:This tag groups all the activities used in the application.

:It describes the activity declared in an android application. We provide the name of the activity class to it, preceded with a “.”(means the current directory).

:These are for declaring how the activities will be activated etc. Like in the above example, ‘basicElements’ is declared as the MAIN activity of the application, which will be launched by the LAUNCHER.

:It tell about the access it has over the device, like to be able to use GPS services one needs to declare it as:

< /uses-permission>

: It is for the declaring the minimum version of the android above which the application will run. For the android 1.0, it’s 1.

Apart from some of these other elements which can be described in the manifest are:

1. permissions

2. instrumentation

3. uses-library etc.

More can be read here.

[Via http://127bytes.wordpress.com]

No comments:

Post a Comment