Globant
Published in

Globant

Android : Application Manifest Overview for beginners

Image source : Google

What is AndroidManifest.xml file in Android?

  • The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.
  • It is responsible to protect the application to access any protected parts by providing the permissions.
Image source : Google
  • This file contains the information regarding your app level packages and different components activities, services, content providers, etc.

sample example of AndroidManifest.xml file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
  • Now let’s go through the element of AndroidManifest.xml :

(a.) <manifest> : manifest is the root element of the AndroidManifest.xml file.It must contain an <application> element and specify xmlns:android and package attributes.

  • Attributes : xmlns:android , package , android:sharedUserId , android:targetSandboxVersion , android:sharedUserLabel, android:versionCode , android:versionName , android:installLocation

(b.) <application> : This element contains several subelements that declares the application component such as activity etc.It is declaration of the application.

  • Many of these attributes (such as icon, label, permission, process, and allowTaskReparenting) set default values for corresponding attributes of the component elements.

(c.) <activity> : This is the subelement of application and represents an activity that must be defined in the AndroidManifest.xml file. It has many attributes such as label, name, theme, launchMode etc.

(d.) <intent-filter> : intent-filter is the sub-element of activity that describes the type of intent to which activity, service or broadcast receiver can respond to.

(e.) <action> : It adds an action for the intent-filter. The intent-filter must have at least one action element.

  • If there are no <action> elements in an intent filter, the filter doesn't accept any Intent objects.
  • Attribute : android:name

(f.) <category> : It adds a category name to an intent-filter

Syntax: 
<category android:name="string" />

These are few reference links for understanding attributes deeply :

Happy Reading :)

--

--

--

Our thoughts as a strategic disruptor in business and cognitive transformation. Visit us at www.globant.com

Recommended from Medium

[Flutter] CRUD PhpMyAdmin (000webhost) via http request

HW#25 Practice of While Loops

Android — 未來 App必須支援公告的兩年內的TargetSdk ,否則新使用者無法下載

Creating a Health PowerUp

How to Fix Apps Keep Crashing on Android Devices

Release Android Library to jCenter

Android Development Roadmap with free Recourses in 2022

How to Build Multiple Apps With a Single Android Project: 2021 Android Productivity Hack

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Richa Sharma

Richa Sharma

Android developer

More from Medium

Android Unit Test Basic

Disabling animations when running Android instrumented tests

Let’s do ChromeCast Videos with Android. — Part 2

How to Make Android Applications?