• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Android Bootcamp Tanzania: android manifest
 

Android Bootcamp Tanzania: android manifest

on

  • 439 views

The Content helps those who wish to program mobile applications using android platform. The content has been used to conduct mobile application boot camps using android platform on different regions ...

The Content helps those who wish to program mobile applications using android platform. The content has been used to conduct mobile application boot camps using android platform on different regions in Tanzania

Statistics

Views

Total Views
439
Views on SlideShare
439
Embed Views
0

Actions

Likes
1
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • {}

Android Bootcamp Tanzania: android manifest Android Bootcamp Tanzania: android manifest Presentation Transcript

  • 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.