Androidmanifest LEARNOVITA

Android Manifest File | The Application Manifest.xml File in Android [ A Complete Guide ]

Last updated on 04th Nov 2022, Artciles, Blog

About author

Grayson (Ionic Developer )

Grayson is an Ionic developer of designing, developing and implementing solutions for Mobile Hybrid App (IONIC) Designing and developing well-tested. He has expertised in set of tools for building native iOS and Android applications, and mobile-ready Progressive Web Apps, using familiar web libraries, frameworks, and languages.

(5.0) | 19855 Ratings 2385
    • In this article you will learn:
    • 1.Introduction.
    • 2.Manifest sub-node tags.
    • 3.Conclusion.

Introduction:

Each project in a Android includes a Manifest XML file, which is an AndroidManifest.xml, located in a root directory of its project hierarchy.The manifest file is the important part of our app because it explains the structure and metadata of a application, its components, and its requirements. This file includes a nodes for each of an Activities, Services, Content Providers, and Broadcast Receivers that make the application, and using a Intent Filters and Permissions finds how they can coordinate with each other and the other applications.

Manifest sub-node tags:

The manifest file also specifies a application metadata, which includes its icon, version number, themes, etc., and an additional top-level nodes can specify any needed permissions, unit tests, and explain hardware, screen, or platform requirements. The manifest comprises a root manifest tag with the package attribute set to project’s package. It should also include a xmls:android attribute that will supply a several system attributes used within a file. Use a versionCode attribute is used to explain the current application version in a form of an integer that increments itself with an iteration of the version due to the update. Also versionName attribute is used to specify public version that will be displayed to users.Can also specify whether our app should install on aSD card of an internal memory using a installLocation attribute. A typical manifest file looks as:

1. Manifest:

The main component of an AndroidManifest.xml file is known as a manifest. Additionally, package field explain the activity class’s package name. It must contain a <"application"> element with xmlns:android and package attribute specified.

2. Uses-sdk:

It is used to explain a minimum and maximum SDK version by means of API Level integer that must be available on the device so that application functions properly, and a target SDK for which it has been designed using the combination of minSdkVersion, maxSdkVersion, and targetSdkVersion attributes, respectively. It is also contained within a <"manifest"> element.

Android Manifest File

3. Uses-permission:

It outlines system permission that must be granted by a user for the app to function properly and is contained within <"manifest"> element. When application is installed the user must grant application permissions.

4. Application:

A manifest can contain only a one application node. It uses the attributes to specify the metadata for application (including its a title, icon, and theme). During the development, should include the debuggable attribute set to true to be enable debugging, then be sure to disable it for release builds. The application node also acts as the container for an Activity, Service, Content Provider, and Broadcast Receiver nodes that specify application components. The name of custom application class can be specified using a android:name attribute.

5. Uses-library:

It explains a shared library against which application must be linked. This element instructs a system to add library’s code to package’s class loader. It is contained within <"application"> element.

6.Activity:

The Activity sub-element of application refers to the activity that needs to be specified in an AndroidManifest.xml file. It has a different characteristics, like a label, name, theme, launchMode, and the others. In manifest file, all elements must be a represented by <"activity">. Any activity that is not a declared there won’t run and won’t be visible to system. It is contained within <"application> element.

7. Intent-filter:

It is a sub-element of activity that specifies a type of intent to which an activity, service, or broadcast receiver can send a response. It allows the component to the receive intents of a certain type while filtering out those that are not useful for acomponent. The intent filter must contain at least one <"action"> element.

Android Manifest

8. Action:

It adds action for an intent-filter. It is contained within a <"intent-filter"> element.

9. Category:

It adds the category name to intent-filter. It is contained within <"intent-filter"> element.

10. Uses-configuration:

The uses-configuration components are used to specify a combination of input mechanisms that are supported by an application. It is useful for games that need a specific input controls.

11. Uses-features:

It is used to specify a which hardware features are application requires. This will prevent the application from being installed on device that does not include required piece of a hardware like a NFC hardware.

12. Permission:

It is used to create a permissions to restrict access to shared the application components. Can also use an existing platform permissions for this purpose or explain own permissions in a manifest.

Conclusion:

Android Manifest is the XML file that contains important metadata about a Android app. This includes the package name activity name, main activity (the app’s entry point), Android version support, hardware features support, permissions, and the other configurations.

Are you looking training with Right Jobs?

Contact Us

Popular Courses