30 Jul 2017

Make AndroidManifest.xml

We need one androidManifest.xml file to describe icon and name of app to be displayed in mobile to user. Also this file will tell which .class file to execute first out of all classes stored in Dex file. We can call it as main class file. Let's make it.

AndroidManifest. xml
manifest xmlns:android = "URI" version=1.0 encoding=utf-8

Above statement tells that all elements inside tags in this XML if prefixed by word 'android' then replace Android by URI. URI can be HTTP:/schema/apk... Etc.

application android:icon="@drawable/myicon" android:label="@string/app name".

Above statement tells what icon to use and what label for this app to be displayed to users. Android URI will be prefixed to icon and label elements. When aapt tool makes apk it will only consider those elements which have this prefix.

activity android:name="Main" android:label="My App"

Above statement uses activity element and says that Main.class code must be executed first and title label should be My App.

intent-filter
action android:name="android.intent.action.MAIN"
category android:name = "android. intent. category.LAUNCHER"
intent-filter

Here optional Activity related commands can be placed.
While Activity refers to screen of mobile placed before user.

So things like making it full screen without title bar or allowing it's auto resizing or panning thereby denying scrolling on pop-up of soft keyboard can be done here.

'activity windowSoftInputMode ="adjustSize|adjustPan" /
'activity Orientation="Portrait"/>
Window feature flag full screen.

activity
application
manifest

In above statement two elements <action>,<category> are defined within <intent-filter> element. User actions of clicking touching mobile screen suggest there intentions. When there intention is fired from launching an app by app launcher service in mobile then the category of intention is stored as LAUNCHER.
Now is the user deleting uninstalling or running this app. If running then action is MAIN.

This manifest will be used two time.
First time when generating R.java and R.class etc.
Second time to generate apk by aapt tool.

No comments:

Post a Comment