Updated 1 February 2022
When we are building the project in Android we have to include a manifest file(AndroidManifest.xml). The AndroidManifest.xml file contains the crucial information of your project, including components used in the project like activities, services, broadcast receivers, etc.
The AndroidManifest.xml file performs various register operations to provide the permissions, like registering the activities inside the application tag.
Each component must define basic properties such as the name of its Kotlin, or Java class. It declares capabilities such as device configurations, and intent filters that describe how the component can be started.
The root element of the Android Manifest must contain an element and android package namespace. The attribute is always to be set as below.
1 2 |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android"> |
The permissions that the app needs in order to access protected parts of the system or other apps. It also declares any permissions that other apps must have if they want to access content from this app.
Like when you are working on an app that wants to access the internet, you need to add extra permission in androidManifest.xml like the below example:
1 2 |
<uses-permission android:name="android.permission.INTERNET" /> |
The manifest can contain only one application tag, to specify the attributes, metadata for the application like title, icon, and theme. The application tag is the parent tag to register all the Activity, Service, Content Provider, and Broadcast Receivers that specify the application components.
1 2 3 4 5 6 |
<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application> |
The activity that implements part of the user interface in the application. All activities must represent by elements in the manifest file. The activity tag has many attributes such as label, name, theme, launch Mode, etc.
1 2 3 4 |
<activity android:name=".activities.MainActivity" android:screenOrientation="portrait" android:theme="@style/FullscreenTheme" /> |
An intent filter declares the capabilities of its parent component, which an activity or service can do, and what types of broadcasts a receiver can handle. The intent filter opens the component to receiving intents for filtering out the extra component.
1 2 3 4 5 |
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> |
Android 11 introduces various changes to strengthen the privacy of the user using the respected app and, also introduces changes related to package visibility on how your apps to query and interact with the other apps installed on a device.
1 2 3 4 5 |
<queries> <intent> <action android:name="android.speech.action.RECOGNIZE_SPEECH" /> </intent> </queries> |
You can also check out the official documentation provided by Google click here.
. . . . . . . . .
That’s it from my side for today, thanks for reading it until now. You can check our other android blogs Click Here.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.