SlideShare a Scribd company logo
Android Application Development




Android Application
AndroidManifest.xml
● Each Android project includes a manifest file,
  AndroidManifest.xml, stored in the root of its project
  hierarchy.
● The manifest defines the structure and metadata of your
  application, its components, and its requirements.
AndroidManifest.xml
● Includes nodes for each of the Activities, Services, Content
  Providers, and Broadcast Receivers that make up your application
  and, using Intent Filters and Permissions, determines how they
  interact with each other and with other applications.

● Specifies application metadata (such as its icon, version number, or
  theme), and additional top-level nodes can specify any required
  permissions and define hardware, screen, or platform requirements

● The manifest is made up of a root manifest tag with a package
  attribute set to the project’s package. It should also include an xmlns:
  android attribute that supplies several system attributes used within
  the file.
AndroidManifest.xml
● versionCode: Define the current application version as an integer
  that increases with each version iteration
● versionName: Specify a public version that will be displayed to users
● installLocation: Specify whether to allow (or prefer) for your
  application be installed on external storage (usually an SD card)
  [preferExternal|auto]
AndroidManifest.xml



● uses-sdk: Enables to define a minimum and maximum SDK version
  that must be available on a device for your application to function
  properly, and target SDK for which it has been designed.
  [minSDKVersion, maxSDKVersion, and targetSDKVersion].
   ○ The minimum SDK version specifies the lowest version of the SDK.
      If not specified a minimum version, it defaults to 1, and your
      application crashes when it attempts to access unavailable APIs.
   ○ The target SDK version attribute enables you to specify the
      platform against which you did your development and testing.
      Good practice is to update the target SDK of your application to
      the latest platform release after you confirm it behaves as
      expected, even if you aren’t making use of any new APIs.
   ○ maxSDKVersion: Unnecessary
AndroidManifest.xml
●   uses-configuration: Specifies each combination of input mechanisms are
    supported by your application. Normally no need to include this node, though
    it can be useful for games that require particular input controls.
     ○ reqFiveWayNav — Specify true for this attribute if you require an input
         device capable of navigating up, down, left, and right and of clicking the
         current selection. This includes both trackballs and directional pads (D-
         pads).
     ○ reqHardKeyboard — If your application requires a hardware keyboard,
         specify true.
     ○ reqKeyboardType — Lets you specify the keyboard type as one of nokeys,
         qwerty, twelvekey, or undefined.
     ○ reqNavigation — Specify the attribute value as one of nonav, dpad,
         trackball, wheel, or undefined as a required navigation device.
     ○ reqTouchScreen — Select one of notouch, stylus, finger, or undefined to
         spec- ify the required touchscreen input.
AndroidManifest.xml
●   uses-feature — Use multiple uses-feature nodes to specify which hardware
    features your application requires. This prevents your application from being
    installed on a device that does not include a required piece of hardware, such
    as NFC hardware, as follows:
         <uses-feature android:name=”android.hardware.nfc” />

You can require support for any hardware that is optional on a compatible device.
Currently, optional hardware features include the following:
     ○ Bluetooth
     ○ Camera
     ○ Location
     ○ Microphone
     ○ NFC
     ○ Sensors
     ○ Telephony
     ○ Touchscreen
     ○ USB
     ○ Wi-Fi
http://developer.android.com/guide/topics/manifest/uses-feature-element.
html#features-reference.
AndroidManifest.xml
●   supports-screens — Enables you to specify the screen sizes your application
    has been designed and tested to. On devices with supported screens, your
    application is laid out normally using the scaling properties associated with
    the layout files you supply.
     ○ smallScreens —typically, QVGA screens
     ○ normalScreens — HVGA, including WVGA and WQVGA.
     ○ largeScreens — Screens larger than normal.
     ○ xlargeScreens — Typically tablet devices.
●   Honeycomb MR2 (API level 13) introduced additional attributes:
     ○ requiresSmallestWidthDp
     ○ compatibleWidthLimitDp
     ○ largestWidthLimitDp
AndroidManifest.xml
●   uses-permission — (Security model), declare the user permissions your
    application requires. Each permission you specify will be presented to the
    user before the application is installed. Permissions are required for many APIs
    and method calls, generally those with an associated cost or security
    implication (such as dialing, receiving SMS, or using the location-based
    services).
<uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION”/>

●   permission — Your application components can also create permissions to
    restrict access to shared application components.
     ○ Your application components can then create permissions by adding an
         android:permission attribute. Then you can include a uses-permission tag
         in your manifest to use these protected components, both in the
         application that includes the protected component and any other
         application that wants to use it.
AndroidManifest.xml
●   application — A manifest can contain only one application node.
     ○ During development if you include a debuggable attribute set to true to
        enable debugging, then be sure to disable it for your release builds.
     ○ The application node also acts as a container for the Activity, Service,
        Content Provider, and Broadcast Receiver nodes that specify the
        application components. You specify the name of your custom application
        class using the android:name attribute.




        ●   activity
        ●   service
        ●   provider
        ●   receiver
        ●   uses-library
Runtime Configuration Changes
●   Android handles runtime changes to the language, location, and hardware by
    terminating and restarting the active Activity.
●   In some special cases this default behavior may be inconvenient.
●   To have an Activity listen for runtime configuration changes, add an android:
    configChanges attribute to its manifest node, specifying the configuration
    changes you want to handle.
     ○ mcc+mnc
     ○ locale
     ○ keyboardHidden
     ○ keyboard
     ○ fontScale
     ○ uiMode
     ○ orientation
     ○ screenLayout
     ○ screenSize
     ○ smallestScreenSize
Runtime Configuration Changes
●   You can select multiple events you want to handle yourself


                                         Test an activity with+without
                                         configChanges while changing orientation
Runtime Configuration Changes
●   Adding an android:configChanges attribute suppresses the restart for the
    specified configuration changes, instead triggering the
    onConfigurationChanged handler in the associated Activity. Override this
    method to handle the configuration changes yourself, using the passed-in
    Configuration object
Android Application Lifecycle
●   Application Class
●   Events
●   Application Lifecycle
●   Application Singleton
Android Activities Revisited
Activity Stacks
Android Activities Revisited
Activity States

More Related Content

What's hot

Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
Shakib Hasan Sumon
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
priya Nithya
 
Android UI
Android UIAndroid UI
Android UI
nationalmobileapps
 
Android Components
Android ComponentsAndroid Components
Android Components
Aatul Palandurkar
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
Soham Patel
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
Eueung Mulyana
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
Aakash Ugale
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
saitej15
 
Introduction to Android ppt
Introduction to Android pptIntroduction to Android ppt
Introduction to Android ppt
Taha Malampatti
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Ahsanul Karim
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
jerry vasoya
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
Kumar
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
Gautam Kumar
 
Android app development
Android app developmentAndroid app development
Android app development
Tanmoy Roy
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
ma-polimi
 

What's hot (20)

Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
 
Android UI
Android UIAndroid UI
Android UI
 
Android Components
Android ComponentsAndroid Components
Android Components
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Android Services
Android ServicesAndroid Services
Android Services
 
Android intents
Android intentsAndroid intents
Android intents
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Introduction to Android ppt
Introduction to Android pptIntroduction to Android ppt
Introduction to Android ppt
 
android activity
android activityandroid activity
android activity
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Android app development
Android app developmentAndroid app development
Android app development
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 

Viewers also liked

Mcq peresentation
Mcq  peresentationMcq  peresentation
Mcq peresentation
Shah Jalal Hridoy
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)Ahsanul Karim
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overviewAhsanul Karim
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul Karim
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
Parinita03
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
Ahsanul Karim
 
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
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting Started
Ahsanul Karim
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & Preferences
Ahsanul Karim
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedAhsanul Karim
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting startedAhsanul Karim
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)Ahsanul Karim
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerAhsanul Karim
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIAhsanul Karim
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting Started
Ahsanul Karim
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in BackgroundAhsanul Karim
 

Viewers also liked (20)

Mcq peresentation
Mcq  peresentationMcq  peresentation
Mcq peresentation
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overview
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
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
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting Started
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & Preferences
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting Started
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 
Client-Server
Client-ServerClient-Server
Client-Server
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation Primer
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting Started
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in Background
 

Similar to AndroidManifest

Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
PERKYTORIALS
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop material
Reza Yogaswara
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla
 
Android App Development - 01 Introduction
Android App Development - 01 IntroductionAndroid App Development - 01 Introduction
Android App Development - 01 Introduction
Diego Grancini
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
Ron Munitz
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)
Ron Munitz
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
Nandini Prabhu
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012
Tomáš Kypta
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
Ted Chien
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
umesh patil
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Codemotion
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
Vijay Rastogi
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
kavinilavuG
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump StartConFoo
 
Cloud Platform as a Service: Heroku
Cloud Platform as a Service: HerokuCloud Platform as a Service: Heroku
Cloud Platform as a Service: Heroku
L&T Technology Services Limited
 
AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018 AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018
Theerasan Tonthongkam
 

Similar to AndroidManifest (20)

Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop material
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Android App Development - 01 Introduction
Android App Development - 01 IntroductionAndroid App Development - 01 Introduction
Android App Development - 01 Introduction
 
Android Technology
Android TechnologyAndroid Technology
Android Technology
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012Android development - the basics, MFF UK, 2012
Android development - the basics, MFF UK, 2012
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump Start
 
Cloud Platform as a Service: Heroku
Cloud Platform as a Service: HerokuCloud Platform as a Service: Heroku
Cloud Platform as a Service: Heroku
 
AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018 AndroidX Google Extended I/O BKK 2018
AndroidX Google Extended I/O BKK 2018
 

More from Ahsanul Karim

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities Ahsanul Karim
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:
Ahsanul Karim
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location API
Ahsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Ahsanul Karim
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycleAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete Study
Ahsanul Karim
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
Ahsanul Karim
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
Ahsanul Karim
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
Ahsanul Karim
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
Ahsanul Karim
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
Ahsanul Karim
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
Ahsanul Karim
 

More from Ahsanul Karim (16)

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location API
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete Study
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
List Views
List ViewsList Views
List Views
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 

AndroidManifest

  • 2. AndroidManifest.xml ● Each Android project includes a manifest file, AndroidManifest.xml, stored in the root of its project hierarchy. ● The manifest defines the structure and metadata of your application, its components, and its requirements.
  • 3. AndroidManifest.xml ● Includes nodes for each of the Activities, Services, Content Providers, and Broadcast Receivers that make up your application and, using Intent Filters and Permissions, determines how they interact with each other and with other applications. ● Specifies application metadata (such as its icon, version number, or theme), and additional top-level nodes can specify any required permissions and define hardware, screen, or platform requirements ● The manifest is made up of a root manifest tag with a package attribute set to the project’s package. It should also include an xmlns: android attribute that supplies several system attributes used within the file.
  • 4. AndroidManifest.xml ● versionCode: Define the current application version as an integer that increases with each version iteration ● versionName: Specify a public version that will be displayed to users ● installLocation: Specify whether to allow (or prefer) for your application be installed on external storage (usually an SD card) [preferExternal|auto]
  • 5. AndroidManifest.xml ● uses-sdk: Enables to define a minimum and maximum SDK version that must be available on a device for your application to function properly, and target SDK for which it has been designed. [minSDKVersion, maxSDKVersion, and targetSDKVersion]. ○ The minimum SDK version specifies the lowest version of the SDK. If not specified a minimum version, it defaults to 1, and your application crashes when it attempts to access unavailable APIs. ○ The target SDK version attribute enables you to specify the platform against which you did your development and testing. Good practice is to update the target SDK of your application to the latest platform release after you confirm it behaves as expected, even if you aren’t making use of any new APIs. ○ maxSDKVersion: Unnecessary
  • 6. AndroidManifest.xml ● uses-configuration: Specifies each combination of input mechanisms are supported by your application. Normally no need to include this node, though it can be useful for games that require particular input controls. ○ reqFiveWayNav — Specify true for this attribute if you require an input device capable of navigating up, down, left, and right and of clicking the current selection. This includes both trackballs and directional pads (D- pads). ○ reqHardKeyboard — If your application requires a hardware keyboard, specify true. ○ reqKeyboardType — Lets you specify the keyboard type as one of nokeys, qwerty, twelvekey, or undefined. ○ reqNavigation — Specify the attribute value as one of nonav, dpad, trackball, wheel, or undefined as a required navigation device. ○ reqTouchScreen — Select one of notouch, stylus, finger, or undefined to spec- ify the required touchscreen input.
  • 7. AndroidManifest.xml ● uses-feature — Use multiple uses-feature nodes to specify which hardware features your application requires. This prevents your application from being installed on a device that does not include a required piece of hardware, such as NFC hardware, as follows: <uses-feature android:name=”android.hardware.nfc” /> You can require support for any hardware that is optional on a compatible device. Currently, optional hardware features include the following: ○ Bluetooth ○ Camera ○ Location ○ Microphone ○ NFC ○ Sensors ○ Telephony ○ Touchscreen ○ USB ○ Wi-Fi http://developer.android.com/guide/topics/manifest/uses-feature-element. html#features-reference.
  • 8. AndroidManifest.xml ● supports-screens — Enables you to specify the screen sizes your application has been designed and tested to. On devices with supported screens, your application is laid out normally using the scaling properties associated with the layout files you supply. ○ smallScreens —typically, QVGA screens ○ normalScreens — HVGA, including WVGA and WQVGA. ○ largeScreens — Screens larger than normal. ○ xlargeScreens — Typically tablet devices. ● Honeycomb MR2 (API level 13) introduced additional attributes: ○ requiresSmallestWidthDp ○ compatibleWidthLimitDp ○ largestWidthLimitDp
  • 9. AndroidManifest.xml ● uses-permission — (Security model), declare the user permissions your application requires. Each permission you specify will be presented to the user before the application is installed. Permissions are required for many APIs and method calls, generally those with an associated cost or security implication (such as dialing, receiving SMS, or using the location-based services). <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION”/> ● permission — Your application components can also create permissions to restrict access to shared application components. ○ Your application components can then create permissions by adding an android:permission attribute. Then you can include a uses-permission tag in your manifest to use these protected components, both in the application that includes the protected component and any other application that wants to use it.
  • 10. AndroidManifest.xml ● application — A manifest can contain only one application node. ○ During development if you include a debuggable attribute set to true to enable debugging, then be sure to disable it for your release builds. ○ The application node also acts as a container for the Activity, Service, Content Provider, and Broadcast Receiver nodes that specify the application components. You specify the name of your custom application class using the android:name attribute. ● activity ● service ● provider ● receiver ● uses-library
  • 11. Runtime Configuration Changes ● Android handles runtime changes to the language, location, and hardware by terminating and restarting the active Activity. ● In some special cases this default behavior may be inconvenient. ● To have an Activity listen for runtime configuration changes, add an android: configChanges attribute to its manifest node, specifying the configuration changes you want to handle. ○ mcc+mnc ○ locale ○ keyboardHidden ○ keyboard ○ fontScale ○ uiMode ○ orientation ○ screenLayout ○ screenSize ○ smallestScreenSize
  • 12. Runtime Configuration Changes ● You can select multiple events you want to handle yourself Test an activity with+without configChanges while changing orientation
  • 13. Runtime Configuration Changes ● Adding an android:configChanges attribute suppresses the restart for the specified configuration changes, instead triggering the onConfigurationChanged handler in the associated Activity. Override this method to handle the configuration changes yourself, using the passed-in Configuration object
  • 14. Android Application Lifecycle ● Application Class ● Events ● Application Lifecycle ● Application Singleton