Android Manifest

Sometime back I wrote a tutorial on Android hello world and lots of friends asked for more on Android. With respect to Android I share the same passion with you my friends. I want to write some good android apps and put it in Google store. I am starting up a series of tutorial on Android and welcome you to follow them. I give you a promise, “after reading around 10 to 15 tutorials in this android series you will be able to develop an android app”. Who knows, some of our readers may even go on to become a millionaire by selling android apps through Google store.

Couple of series that are presently running are design patterns and Spring framework. Specialty about these series are, there is no particular order to read. You can read any article and in any order you prefer. You can also skip if you don’t like some. Based on popular request from friends, I am adding Android to this list. Hibernate and Struts fans, I am listening please wait for some more time and I will soon start writing on them too.

AndroidManifest.xml

Manifest file for an android application is a resource file which contains all the details needed by the android system about the application. It is a key file that works as a bridge between the android developer and the android platform. It helps the developer to pass on functionality and requirements of our application to Android. This is an xml file which must be named as AndroidManifest.xml and placed at application root. Every Android app must have AndroidManifest.xml file. AndroidManifest.xml allows us to define,

The packages, API, libraries needed for the application.

Elements of AndroidManifest.xml

Following are the elements(listed alphabetically) that can appear in AndroidManifest.xml, this list is restricted and we cannot add our own elements to it.

<action>
<activity>
<activity-alias>
<application>
<category>
<data>
<grant-uri-permission>
<instrumentation>
<intent-filter>
<manifest>
<meta-data>
<permission>
<permission-group>
<permission-tree>
<provider>
<receiver>
<service>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-library>
<uses-permission>
<uses-sdk>

Elements for Application Properties

Elements for Application Components

These should be enclosed in <application> container.

These entire information has to be known by the system to run any file of the application. So that this file has to be created at the time of installing and not at the time of running the application.

If this is the second tutorial after Hello World, you may not be able to understand every element listed. Don’t worry, I just wanted to give an overview. As we progress we will understand about each of these in detail.

Structure of AndroidManifest.xml

<manifest>
<Elements for Application properties should come here - refer above for list>

<application>

<Elements for application components should come here - refere above for list>

</application>

</manifest>

Sample AndroidManifest.xml

Following is a sample Android manifest file that was created as part of a android hello world application.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.javapapers.android"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".HelloWorld" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

This Android tutorial was added on 26/08/2012.

Comments on "Android Manifest" Tutorial:

  1. SUNIL KUMAR says:

    Nice Tutorial :)

  2. Suresh says:

    pls continue spring.

  3. Deepesh Uniyal says:

    Nice One..
    Waiting 4 next topic impatiently….
    Thanks.

  4. Ritanshu Goel says:

    nice one..

  5. Anonymous says:

    As usual good explanation.. Please continue SPRING tutorial..

  6. Anonymous says:

    Thanks Joe .. but would be waiting to see more articles on Spring :)

  7. kruthi says:

    really superb…..

  8. Chaudhary says:

    Thanks a lot Joe for such a great article about androidmanifest.xml…waiting to see more articles on android.. :)

  9. Raviteja says:

    Please explore more on spring , like DAO, MVC , Integration with Hibernate etc., Request you not to stop the flow. You are very good , when it comes to explaining concepts to People . So oly asking :)

  10. Pooja says:

    Thanks for Android post ! Its wonderful becomes very useful to us ~!Keep posting this type of articles :-)

  11. Kalmesh says:

    Thanks Joe….. I always used read your post… Keep on posting stuffs like Android, Spring. in spring i know only MVC, but i heard from friends like there is spring security, Can you write on this. I am waiting for your reply.

    Once again thanks for your wonderful blog contents.

  12. syed says:

    Nice,.. thanks

  13. Victor says:

    Thanks!
    Will look forward for future articles.

  14. Maurice Krause says:

    Android application is a resource file which contains all the details needed by the android system about the application.such a great article about androidmanifest.xml

  15. Prashant says:

    Great post

  16. […] Android activity should be declared in the Android manifest […]

  17. Anonymous says:

    nice tutorial….

  18. […] for each functions for which the components are responsible. These intent filters are specified in Android Manifest file. All the intents passing to the component will be filtered through these set of intent filters to […]

  19. rizwan says:

    Goodd…

  20. […] access current location information through location providers, we need to set permissions with android manifest […]

  21. […] Declare service in AndroidManifest.xml file. […]

  22. kiran says:

    Thanks.

  23. nathansrags says:

    Nice posts. really good.

  24. nitesh says:

    i connect android to php api pls help

  25. […] should have following tag in Android Manifest to get Internet […]

  26. […] Android manifest file is important here. Just note the “uses-permission” tag below. We need to those tags for accessing GPS and network provider. […]

  27. deepu_kdl says:

    hi,
    please elaborate on difference between and .

Comments are closed for this "Android Manifest" tutorial.