SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 studioParinita03
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development pptGautam Kumar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
android content providers
android content providersandroid content providers
android content providersDeepa Rani
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on androidLi SUN
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecturedeepakshare
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Android Components & Manifest
Android Components & ManifestAndroid Components & Manifest
Android Components & Manifestma-polimi
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Androidguest213e237
 
Layouts in android
Layouts in androidLayouts in android
Layouts in androidDurai S
 
Android animation
Android animationAndroid animation
Android animationKrazy Koder
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferencesAjay Panchal
 
Android graphics
Android graphicsAndroid graphics
Android graphicsKrazy Koder
 

Was ist angesagt? (20)

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
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
android layouts
android layoutsandroid layouts
android layouts
 
android content providers
android content providersandroid content providers
android content providers
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Activity lifecycle
Activity lifecycleActivity lifecycle
Activity lifecycle
 
Android Components & Manifest
Android Components & ManifestAndroid Components & Manifest
Android Components & Manifest
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Android animation
Android animationAndroid animation
Android animation
 
Notification android
Notification androidNotification android
Notification android
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Android - ADB
Android - ADBAndroid - ADB
Android - ADB
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferences
 
Android graphics
Android graphicsAndroid graphics
Android graphics
 

Andere mochten auch

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
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentAhsanul 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 StartedAhsanul 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 & PreferencesAhsanul 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 StartedAhsanul Karim
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in BackgroundAhsanul Karim
 

Andere mochten auch (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 Services
Android ServicesAndroid Services
Android Services
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
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
 

Ähnlich wie AndroidManifest

Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programmingPERKYTORIALS
 
Android workshop material
Android workshop materialAndroid workshop material
Android workshop materialReza 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 WorkshopKasun Dananjaya Delgolla
 
Android App Development - 01 Introduction
Android App Development - 01 IntroductionAndroid App Development - 01 Introduction
Android App Development - 01 IntroductionDiego 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 ApplicationNandini Prabhu
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
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, 2012Tomáš 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 perspectiveGunjan Kumar
 
Mobile application development
Mobile application developmentMobile application development
Mobile application developmentumesh 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 2015Codemotion
 
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 structureVijay Rastogi
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump StartConFoo
 
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
 

Ähnlich wie 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
 

Mehr von 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 APIAhsanul 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 StudyAhsanul Karim
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_startedAhsanul Karim
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorialAhsanul Karim
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Ahsanul Karim
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Ahsanul Karim
 

Mehr von 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