SlideShare ist ein Scribd-Unternehmen logo
1 von 45
© Frank Mueller & Seokyong Hong (TA)   North Carolina State University Center for Efficient, Secure and Reliable Computing Android Application Model (3) Except as otherwise noted, the content of this presentation is  licensed under the Creative Commons Attribution 2.5 License.
Android Application Package ,[object Object],[object Object],.apk  Java Code Data Files Resources  Files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Application Components ,[object Object],[object Object],[object Object],Components Description Activity UI component typically corresponding to one screen Service Background process without UI Broadcast Receiver Component that responds to broadcast Intents Content Provider Component that enables applications to share data
Components - Activity ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Components - Activity (Cont) ,[object Object],[object Object]
Components - Service ,[object Object],[object Object],[object Object],[object Object],[object Object],Media Player Activity Service Background running for playback Binder Notification Communication Pause/rewind /stop/restart
Components - Service (Cont) ,[object Object]
Components - Broadcast Receivers ,[object Object],[object Object],[object Object],SMS Broadcast Receiver Activity ,[object Object],[object Object]
Components - Broadcast Receivers (Cont) ,[object Object],[object Object],[object Object],[object Object]
Components - Content Providers ,[object Object],[object Object],Activity Application Activity Application Activity Content Provider Service Application Data SQLite XML Remote  Store Content Resolver Content Resolver Content Resolver
Components - Content Providers (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Intents ,[object Object],[object Object],[object Object],startActivity(new Intent(Intent.VIEW_ACTION, Uri.parse("http://www.fhnw.ch")); startActivity(new Intent(Intent.VIEW_ACTION, Uri.parse("geo:47.480843,8.211293")); startActivity(new Intent(Intent.EDIT_ACTION,Uri.parse("content://contacts/people/1"));
Intents (Cont) ,[object Object],[object Object],[object Object]
Intents (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Android Component Model ,[object Object],[object Object],[object Object],[object Object],[object Object],Application (.apk) Process Activity Activity Activity Activity Content Provider Service Service
Activities and Tasks ,[object Object],Activity Activity Context.startActivity(Intent) or Activity.startActivityForResult (Intent, Request_Code) ① Asynchronous Message (Intent) ② To get some result (e.g. to get a photo) No return
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],Application (.apk) Process Activity Activity Activity Activity Content Provider Service Service Application (.apk) Process Activity Activity Activity Activity Content Provider Service Service
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object],Instance of Activity B Instance of Activity C Instance of Activity B Instance of Activity A A Stack The one that began the task (typically, an activity the user selected in the application launcher) The one that's currently running
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],New Activity Activity A Root Activity Original Task Activity A Root Activity Original Task New Activity New Task standard/singleTop without FLAG_ACTIVITY_NEW_TASK singleTask/singleInstance
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],Activity B Activity A Task A Activity D Task B Activity B and Activity C are  standard/singleTop Activity C Activity B Activity C Activity B Activity A Task A Activity C Task B Activity C is singleTask or singleInstance
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],"standard" ,[object Object],[object Object],"singleTop" "singleTask" "singleInstance" ,[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],Activity B Activity A Activity C Original Task Activity D An intent arrives for an activity of type D Activity B Activity A Activity C Activity D Activity D If D is"standard" Activity B Activity A Activity C Activity D If D is"singleTop" The existing instance D is expected to handle the new intent (since it's at the top of the stack)
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],Activity B Activity A Activity C Original Task Activity D An intent arrives for an activity of type B Activity B Activity A Activity C Activity D If B is"standard" Activity B Activity A Activity C Activity D If B is"singleTop" The existing instance B is not expected to handle the new intent (since it's not at the top of the stack) Activity B Activity B
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],Activity B Original Task An intent arrives for an activity of type B If B is"singleInstance" A "singleInstance" activity is always at the top of the stack, so it is always in position to handle the intent. Activity B
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],Activity B Original Task An intent arrives for an activity of type B If B is"singleTask"  Activity B can handle the intent since it is in position. Activity B Activity A Activity A Activity B Original Task An intent arrives for an activity of type B If B is"singleTask"  Activity B cannot handle the intent since it is not in position and the intent is dropped. Activity B Activity A Activity A
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activities and Tasks (Cont) ,[object Object],[object Object]
Processes and Threads ,[object Object],[object Object],[object Object],Application (.apk) Process Main Thread 1 1
Processes and Threads (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Processes and Threads (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Processes and Threads (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles ,[object Object],[object Object],[object Object],[object Object],[object Object],State Description Running ,[object Object],Paused ,[object Object],Stopped ,[object Object],[object Object]
Component Lifecycles ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object],[object Object]
Component Lifecycles (Cont) ,[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Versions of Android OS
Versions of Android OSVersions of Android OS
Versions of Android OSHaseeb
 
Android auto
Android autoAndroid auto
Android autodhiraj007
 
Characteristics of a well designed user interface
Characteristics of a well designed user interfaceCharacteristics of a well designed user interface
Characteristics of a well designed user interfaceThomas Byttebier
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Manoj Ellappan
 
Presentation On Android
Presentation On AndroidPresentation On Android
Presentation On AndroidTeachMission
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Android notification
Android notificationAndroid notification
Android notificationKrazy Koder
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming SeminarNhat Nguyen
 
Presentation on Android
Presentation on AndroidPresentation on Android
Presentation on AndroidNausad Ahamed
 
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentationAhmed Mamdouh
 
Mobile operating system (os)
Mobile operating system (os)Mobile operating system (os)
Mobile operating system (os)AMIT GUPTA
 

Was ist angesagt? (20)

Mobile Web Apps
Mobile Web AppsMobile Web Apps
Mobile Web Apps
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Versions of Android OS
Versions of Android OSVersions of Android OS
Versions of Android OS
 
Android UI
Android UIAndroid UI
Android UI
 
Android auto
Android autoAndroid auto
Android auto
 
Characteristics of a well designed user interface
Characteristics of a well designed user interfaceCharacteristics of a well designed user interface
Characteristics of a well designed user interface
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Notification android
Notification androidNotification android
Notification android
 
Presentation On Android
Presentation On AndroidPresentation On Android
Presentation On Android
 
Android Components
Android ComponentsAndroid Components
Android Components
 
android activity
android activityandroid activity
android activity
 
Android notification
Android notificationAndroid notification
Android notification
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming Seminar
 
Presentation on Android
Presentation on AndroidPresentation on Android
Presentation on Android
 
Photoshop
PhotoshopPhotoshop
Photoshop
 
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentation
 
Mobile operating system (os)
Mobile operating system (os)Mobile operating system (os)
Mobile operating system (os)
 
Ios development
Ios developmentIos development
Ios development
 

Andere mochten auch

Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstackrajdeep
 
PROMAND 2014 project structure
PROMAND 2014 project structurePROMAND 2014 project structure
PROMAND 2014 project structureAlexey Buzdin
 
Manipulating Android tasks and back stack
Manipulating Android tasks and back stackManipulating Android tasks and back stack
Manipulating Android tasks and back stackRan Nachmany
 
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) ExamplesJava Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) ExamplesShridhar Ramesh
 
Online Voting System-using Advanced Java
Online Voting System-using Advanced JavaOnline Voting System-using Advanced Java
Online Voting System-using Advanced JavaSarthak Srivastava
 
Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Viswanath J
 

Andere mochten auch (6)

Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstack
 
PROMAND 2014 project structure
PROMAND 2014 project structurePROMAND 2014 project structure
PROMAND 2014 project structure
 
Manipulating Android tasks and back stack
Manipulating Android tasks and back stackManipulating Android tasks and back stack
Manipulating Android tasks and back stack
 
Java Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) ExamplesJava Object-Oriented Programming Conecpts(Real-Time) Examples
Java Object-Oriented Programming Conecpts(Real-Time) Examples
 
Online Voting System-using Advanced Java
Online Voting System-using Advanced JavaOnline Voting System-using Advanced Java
Online Voting System-using Advanced Java
 
Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009
 

Ähnlich wie Android application model

Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2Tadas Jurelevičius
 
Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Dr. Ramkumar Lakshminarayanan
 
Kotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKnoldus Inc.
 
Android 101 Session @thejunction32
Android 101 Session @thejunction32Android 101 Session @thejunction32
Android 101 Session @thejunction32Eden Shochat
 
Android application structure
Android application structureAndroid application structure
Android application structureAlexey Ustenko
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycleKumar
 
Unit 5 Activity and Activity Life Cycle.pptx
Unit 5 Activity and Activity Life Cycle.pptxUnit 5 Activity and Activity Life Cycle.pptx
Unit 5 Activity and Activity Life Cycle.pptxShantanuDharekar
 
Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company Arna Softech Private Limited
 
Android application development
Android application developmentAndroid application development
Android application developmentMd. Mujahid Islam
 
Android development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2DHIRAJ PRAVIN
 

Ähnlich wie Android application model (20)

Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3Android building blocks and application life cycle-chapter3
Android building blocks and application life cycle-chapter3
 
Unit2
Unit2Unit2
Unit2
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Kotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKotlin for Android App Development Presentation
Kotlin for Android App Development Presentation
 
Android 101 Session @thejunction32
Android 101 Session @thejunction32Android 101 Session @thejunction32
Android 101 Session @thejunction32
 
Mobile testing android
Mobile testing   androidMobile testing   android
Mobile testing android
 
Android application structure
Android application structureAndroid application structure
Android application structure
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Activity
ActivityActivity
Activity
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
 
Unit 5 Activity and Activity Life Cycle.pptx
Unit 5 Activity and Activity Life Cycle.pptxUnit 5 Activity and Activity Life Cycle.pptx
Unit 5 Activity and Activity Life Cycle.pptx
 
Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2
 

Mehr von magicshui

网络信息管理-rss介绍-方案1
网络信息管理-rss介绍-方案1网络信息管理-rss介绍-方案1
网络信息管理-rss介绍-方案1magicshui
 
网络信息管理-rss介绍-方案2
网络信息管理-rss介绍-方案2网络信息管理-rss介绍-方案2
网络信息管理-rss介绍-方案2magicshui
 
.Net网络编程入门
.Net网络编程入门.Net网络编程入门
.Net网络编程入门magicshui
 
Android platform overview
Android platform overviewAndroid platform overview
Android platform overviewmagicshui
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guidemagicshui
 
计算机网络:复习
计算机网络:复习计算机网络:复习
计算机网络:复习magicshui
 
Hetaoo come on
Hetaoo come onHetaoo come on
Hetaoo come onmagicshui
 

Mehr von magicshui (8)

网络信息管理-rss介绍-方案1
网络信息管理-rss介绍-方案1网络信息管理-rss介绍-方案1
网络信息管理-rss介绍-方案1
 
网络信息管理-rss介绍-方案2
网络信息管理-rss介绍-方案2网络信息管理-rss介绍-方案2
网络信息管理-rss介绍-方案2
 
.Net网络编程入门
.Net网络编程入门.Net网络编程入门
.Net网络编程入门
 
Android platform overview
Android platform overviewAndroid platform overview
Android platform overview
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 
One
OneOne
One
 
计算机网络:复习
计算机网络:复习计算机网络:复习
计算机网络:复习
 
Hetaoo come on
Hetaoo come onHetaoo come on
Hetaoo come on
 

Android application model

  • 1. © Frank Mueller & Seokyong Hong (TA) North Carolina State University Center for Efficient, Secure and Reliable Computing Android Application Model (3) Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.

Hinweis der Redaktion

  1. 1