SlideShare una empresa de Scribd logo
1 de 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]

Más contenido relacionado

La actualidad más candente

[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event HandlingNikmesoft Ltd
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivityAhsanul Karim
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTvineet raj
 
Intent, Service and BroadcastReciver (2).ppt
Intent, Service and BroadcastReciver (2).pptIntent, Service and BroadcastReciver (2).ppt
Intent, Service and BroadcastReciver (2).pptBirukMarkos
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestateOsahon Gino Ediagbonya
 
Android Web app
Android Web app Android Web app
Android Web app Sumit Kumar
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & viewsma-polimi
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorageKrazy Koder
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layoutKrazy Koder
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Introduction to plotting in Python
Introduction to plotting in Python Introduction to plotting in Python
Introduction to plotting in Python bzamecnik
 
Android app development
Android app developmentAndroid app development
Android app developmentTanmoy Roy
 
Control Structures in Python
Control Structures in PythonControl Structures in Python
Control Structures in PythonSumit Satam
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.netBhumivaghasiya
 

La actualidad más candente (20)

[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event Handling
 
Broadcast receivers
Broadcast receiversBroadcast receivers
Broadcast receivers
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Intent, Service and BroadcastReciver (2).ppt
Intent, Service and BroadcastReciver (2).pptIntent, Service and BroadcastReciver (2).ppt
Intent, Service and BroadcastReciver (2).ppt
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
 
Android Web app
Android Web app Android Web app
Android Web app
 
Android Report
Android ReportAndroid Report
Android Report
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorage
 
WPF
WPFWPF
WPF
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
android activity
android activityandroid activity
android activity
 
4. algorithm
4. algorithm4. algorithm
4. algorithm
 
Introduction to plotting in Python
Introduction to plotting in Python Introduction to plotting in Python
Introduction to plotting in Python
 
Android app development
Android app developmentAndroid app development
Android app development
 
Control Structures in Python
Control Structures in PythonControl Structures in Python
Control Structures in Python
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Más de 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
 

Más de 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.

Notas del editor

  1. 1