SlideShare a Scribd company logo
1 of 14
ANDROID MANIFEST
Android Manifest xml File






Every application must have an A ro id
nd
M nife s t. x m l file
a
(with precisely that name) in its root directory.
The manifest presents essential information
about the application to the Android system.


information the system must have before it can run
any of the application's code.
Android Manifest xml File
Android Manifest xml File











<action>
<activity>
<activity-alias>
<application>
<category>
<data>
<grant-uri-permission>
<instrumentation>
<intent-filter>
<manifest>













<meta-data>
<permission>
<permission-group>
<permission-tree>
<provider>
<receiver>
<service>
<uses-configuration>
<uses-library>
<uses-permission>
<uses-sdk>
AndroidManifest.xml


Applications should declare everything needed
on the the AndroidManifest.xml file …



One AndroidManifest.xml for application ..



What's contained in it?






Pe rm is s io ns
Hw a nd Sw re s o urc e s us e d by the
A p lic a tio n
p
A tivitie s
c
I nt-filte rs
nte
5
Android Manifest xml File






The manifest is made up of a root manifest ta g
with a package attribute set to the project’s
package.
It usually includes an x m lns : a nd ro id attribute
that supplies several system attributes used
within the file.
The m a nife s t ta g includes nodes that define the
application components, security settings, and
test classes that make up your application.
Activities and
AndroidManifest.xml






An Android application can be composed of
multiple Activities …
Each activity should be declared in the file:
AndroidManifest.xml
Add a child element of <application>:
<application>
<activity android:name=".MyActivity" />
<activity android:name=”.SecondActivity" />
</application>

7
AndroidManifest.xml
example
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application android:icon="@drawable/icon.png" >
<activity
android:name="com.example.project.MyActivity"
android:label="@string/label">
</activity>
</application>
</manifest>

8
Android Manifest xml File








Available manifest node tags, and an XML snippet
demonstrating how each one is used:
A p lic a tio n: A manifest can contain only one application
p
node.
It uses attributes to specify the metadata for your
application (including its title, icon, and theme).
It also acts as a container that includes the Activity,
Service, Content Provider, and Broadcast Receiver tags
used to specify the application components.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<manifest>


The manifest tag has the following attributes:


xmlns ; the name of the namespace (android) and
where the DTD for the xml parser is located.



package ; the name of the java package for this
application (must have at least two levels).



android:version ; the version code for this version of the
app.



android:versionName ; The version name (for
publishing)
<activity>


Child tag of <manifest>
Need one <activity> tag for each activity of the
application



Attributes:





android:name; the name of the activity, this will be
used as the name of the Java file and the
resulting class.



android:label; a string that we will be able to
programmatically retrieve the activity name at run
time.
<intent-filter>









Child tag of <activity>
First, what’s an intent? In OO-speak an intent is a message sent
from one program to another (message dispatcher) to tell the
system what to do next.
Typically an intent consists of two parts; an action and the data
that that action is supposed to use to do it.
When you select an icon on the main page the intent is to run the
app associated with that icon.
The tag is used to construct an android.content.IntentFilter object
to handle a particular android.content.Intent
Launcher






When you create a new application using the
Android SDK tools.
The stub activity that's created for you
automatically includes an intent filter that
declares the activity responds to the "main"
action.
It should be placed in the "launcher" category.

More Related Content

What's hot

Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversCodeAndroid
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Androidma-polimi
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - AndroidWingston
 
Broadcast Receivers in Android
Broadcast Receivers in AndroidBroadcast Receivers in Android
Broadcast Receivers in Androidma-polimi
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & viewsma-polimi
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介easychen
 
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversMingHo Chang
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesAhsanul Karim
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyRichard Lord
 

What's hot (18)

Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
 
Android components
Android componentsAndroid components
Android components
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Android
 
Android Basics
Android BasicsAndroid Basics
Android Basics
 
Android Components
Android ComponentsAndroid Components
Android Components
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
Broadcast Receivers in Android
Broadcast Receivers in AndroidBroadcast Receivers in Android
Broadcast Receivers in Android
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android session 3
Android session 3Android session 3
Android session 3
 
Android session 1
Android session 1Android session 1
Android session 1
 
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through Activities
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The Ugly
 
Activity
ActivityActivity
Activity
 

Similar to Android Bootcamp Tanzania: android manifest

Hello android world
Hello android worldHello android world
Hello android worldeleksdev
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2Vivek Bhusal
 
android notes for bachelor of technology.pptx
android notes for bachelor of technology.pptxandroid notes for bachelor of technology.pptx
android notes for bachelor of technology.pptxVishwaRahul
 
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...Eng Teong Cheah
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Advance Android application development workshop day 3
Advance Android application development workshop day 3Advance Android application development workshop day 3
Advance Android application development workshop day 3cresco
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldTarunsingh198
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development BasicMonir Zzaman
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development PracticesRoy Clarkson
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in androidMahmudul Hasan
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusEng Teong Cheah
 
Android Application that makes use of RSS Feed.pptx
Android Application that makes use of RSS Feed.pptxAndroid Application that makes use of RSS Feed.pptx
Android Application that makes use of RSS Feed.pptxvishal choudhary
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principlesHenk Laracker
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 

Similar to Android Bootcamp Tanzania: android manifest (20)

Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
Android Programming.pptx
Android Programming.pptxAndroid Programming.pptx
Android Programming.pptx
 
Hello android world
Hello android worldHello android world
Hello android world
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2
 
android notes for bachelor of technology.pptx
android notes for bachelor of technology.pptxandroid notes for bachelor of technology.pptx
android notes for bachelor of technology.pptx
 
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...
Learn Xamarin Absolute Beginners - Application Manifest, Android Resources & ...
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Advance Android application development workshop day 3
Advance Android application development workshop day 3Advance Android application development workshop day 3
Advance Android application development workshop day 3
 
Ch2 first app
Ch2 first appCh2 first app
Ch2 first app
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development Basic
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
 
Android Application that makes use of RSS Feed.pptx
Android Application that makes use of RSS Feed.pptxAndroid Application that makes use of RSS Feed.pptx
Android Application that makes use of RSS Feed.pptx
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principles
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Unit2
Unit2Unit2
Unit2
 

More from Denis Minja

Android Bootcamp Tanzania:Monetization
Android Bootcamp Tanzania:MonetizationAndroid Bootcamp Tanzania:Monetization
Android Bootcamp Tanzania:MonetizationDenis Minja
 
Android Bootcamp Tanzania:Costech mobile bootcamp monetazation
Android Bootcamp Tanzania:Costech mobile bootcamp monetazationAndroid Bootcamp Tanzania:Costech mobile bootcamp monetazation
Android Bootcamp Tanzania:Costech mobile bootcamp monetazationDenis Minja
 
Android Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intentsAndroid Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intentsDenis Minja
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
Costech mobile bootcamp 2
Costech mobile bootcamp 2Costech mobile bootcamp 2
Costech mobile bootcamp 2Denis Minja
 
Android Bootcamp Tanzania:Overview of android platform
Android Bootcamp Tanzania:Overview of android platformAndroid Bootcamp Tanzania:Overview of android platform
Android Bootcamp Tanzania:Overview of android platformDenis Minja
 
Android Bootcamp Tanzania:Publishing android application
Android Bootcamp Tanzania:Publishing android applicationAndroid Bootcamp Tanzania:Publishing android application
Android Bootcamp Tanzania:Publishing android applicationDenis Minja
 

More from Denis Minja (7)

Android Bootcamp Tanzania:Monetization
Android Bootcamp Tanzania:MonetizationAndroid Bootcamp Tanzania:Monetization
Android Bootcamp Tanzania:Monetization
 
Android Bootcamp Tanzania:Costech mobile bootcamp monetazation
Android Bootcamp Tanzania:Costech mobile bootcamp monetazationAndroid Bootcamp Tanzania:Costech mobile bootcamp monetazation
Android Bootcamp Tanzania:Costech mobile bootcamp monetazation
 
Android Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intentsAndroid Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intents
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
Costech mobile bootcamp 2
Costech mobile bootcamp 2Costech mobile bootcamp 2
Costech mobile bootcamp 2
 
Android Bootcamp Tanzania:Overview of android platform
Android Bootcamp Tanzania:Overview of android platformAndroid Bootcamp Tanzania:Overview of android platform
Android Bootcamp Tanzania:Overview of android platform
 
Android Bootcamp Tanzania:Publishing android application
Android Bootcamp Tanzania:Publishing android applicationAndroid Bootcamp Tanzania:Publishing android application
Android Bootcamp Tanzania:Publishing android application
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Android Bootcamp Tanzania: android manifest

  • 2. Android Manifest xml File    Every application must have an A ro id nd M nife s t. x m l file a (with precisely that name) in its root directory. The manifest presents essential information about the application to the Android system.  information the system must have before it can run any of the application's code.
  • 4. Android Manifest xml File           <action> <activity> <activity-alias> <application> <category> <data> <grant-uri-permission> <instrumentation> <intent-filter> <manifest>            <meta-data> <permission> <permission-group> <permission-tree> <provider> <receiver> <service> <uses-configuration> <uses-library> <uses-permission> <uses-sdk>
  • 5. AndroidManifest.xml  Applications should declare everything needed on the the AndroidManifest.xml file …  One AndroidManifest.xml for application ..  What's contained in it?     Pe rm is s io ns Hw a nd Sw re s o urc e s us e d by the A p lic a tio n p A tivitie s c I nt-filte rs nte 5
  • 6. Android Manifest xml File    The manifest is made up of a root manifest ta g with a package attribute set to the project’s package. It usually includes an x m lns : a nd ro id attribute that supplies several system attributes used within the file. The m a nife s t ta g includes nodes that define the application components, security settings, and test classes that make up your application.
  • 7. Activities and AndroidManifest.xml    An Android application can be composed of multiple Activities … Each activity should be declared in the file: AndroidManifest.xml Add a child element of <application>: <application> <activity android:name=".MyActivity" /> <activity android:name=”.SecondActivity" /> </application> 7
  • 8. AndroidManifest.xml example <?xml version="1.0" encoding="utf-8"?> <manifest> <application android:icon="@drawable/icon.png" > <activity android:name="com.example.project.MyActivity" android:label="@string/label"> </activity> </application> </manifest> 8
  • 9. Android Manifest xml File     Available manifest node tags, and an XML snippet demonstrating how each one is used: A p lic a tio n: A manifest can contain only one application p node. It uses attributes to specify the metadata for your application (including its title, icon, and theme). It also acts as a container that includes the Activity, Service, Content Provider, and Broadcast Receiver tags used to specify the application components.
  • 10. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandroid" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
  • 11. <manifest>  The manifest tag has the following attributes:  xmlns ; the name of the namespace (android) and where the DTD for the xml parser is located.  package ; the name of the java package for this application (must have at least two levels).  android:version ; the version code for this version of the app.  android:versionName ; The version name (for publishing)
  • 12. <activity>  Child tag of <manifest> Need one <activity> tag for each activity of the application  Attributes:   android:name; the name of the activity, this will be used as the name of the Java file and the resulting class.  android:label; a string that we will be able to programmatically retrieve the activity name at run time.
  • 13. <intent-filter>      Child tag of <activity> First, what’s an intent? In OO-speak an intent is a message sent from one program to another (message dispatcher) to tell the system what to do next. Typically an intent consists of two parts; an action and the data that that action is supposed to use to do it. When you select an icon on the main page the intent is to run the app associated with that icon. The tag is used to construct an android.content.IntentFilter object to handle a particular android.content.Intent
  • 14. Launcher    When you create a new application using the Android SDK tools. The stub activity that's created for you automatically includes an intent filter that declares the activity responds to the "main" action. It should be placed in the "launcher" category.

Editor's Notes

  1. {}