SlideShare a Scribd company logo
1 of 27
Download to read offline
OpenIntents
     www.OpenIntents.org




                          ANDROID
                       FUNDAMENTALS
                         REVISITED

@_zero
zero@openintents.biz
OpenIntents                OpenIntents
       www.OpenIntents.org




● Founded in 2009
● Open Source based Company

● Two times winners of Google Android Developer Challenge

● Over 15 Apps in the Market (Free + Paid )

● Services:

  ● Reusable components

  ● Intents Registry

  ● Developer Support

  ● Consulting

  ● App Development




●
    Mentoring organization in Summer of Code 2011
OpenIntents
www.OpenIntents.org                             Topics




                      ●   Activity Lifecycle

                      ●   Activity Manager

                          ●   Concepts

                          ●   Components

                      ●   Why there is no App

                      ●   Permissions

                      ●   Gingerbread
OpenIntents
www.OpenIntents.org   Who you're gonna call ?
OpenIntents
www.OpenIntents.org    Activities




                      ActivityManagerService
OpenIntents
www.OpenIntents.org            ActivityManagerService




●   Project: frameworks/base.git

●   Package: com.android.server.am

●   Pure Java

●   Started by SystemServer, running as system process

●   Creates the System Context

●   Keeps a reference of the Home Screen / Launcher App
OpenIntents
    www.OpenIntents.org       What does ActivityManagerService do ?


●    Start, stop, pause,... Activities

●    Start, stop, pause,... Services

●    Start, stop, pause,... ContentProviders

●    Check Permission

●    Broadcast Intents

●    Start, stop, pause,... Animations

●    Decide window focus

●    Deliver Hardware Events

●    Crash Activities
OpenIntents
www.OpenIntents.org    What does ActivityManagerService do ?




                      EVERYTHING
OpenIntents
www.OpenIntents.org         What does ActivityManagerService do ?




                        EVERYTHING
                      the window manager doesn't
OpenIntents
www.OpenIntents.org         What does ActivityManagerService do ?




                        EVERYTHING
                      the window manager doesn't

                              (ok, almost)
OpenIntents
    www.OpenIntents.org                 Starting an Activity



●    startActivity is called (calls startActivity(Intent, -1)

●    ActivityManagerNative.startActivity(..)

●    Call gets dispatched via AIDL Binder to ActivityManagerService

●    Call is queued in a Handler Message Queue

●    startActivityXX is called

●    startActivityLocked is called
OpenIntents
    www.OpenIntents.org               Starting an Activity



●    Class is resolved

●    Permission check

●    Inform Watchers

●    Create HistoryRecord

●    Check launch Flags

●    Create Task or add to existing

●    Grant Permissions
OpenIntents
    www.OpenIntents.org             Starting an Activity



●    Add to History Stack

●    Prepare Animations

●    Add to WindowManager (creates window)

●    Pause currently running Activities

●    Switch Visibility

●    Calculate & update Configuration (may trigger reset)

●    Resume (make call across Binder into Activity Thread)

●    Set Focus

●    Ensure visibility
OpenIntents
www.OpenIntents.org   Application ?
OpenIntents
www.OpenIntents.org   HistoryRecord
OpenIntents
www.OpenIntents.org   Application ?
OpenIntents
www.OpenIntents.org   Permissions
OpenIntents
www.OpenIntents.org   Permissions
OpenIntents
www.OpenIntents.org   Permissions
OpenIntents
www.OpenIntents.org              Changes in Gingerbread




●   HistoryRecord renamed to ActivityRecord

●   Introduction of Heavyweight Process

    ●   Only one at any given time

●   Parts of lifecycle management moved to ActivityStack

●   Hardware Event / Key input was re-written

●   WindowManager now has an extra “secure” layer

●   ...

●   Beautified comments :)
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents

More Related Content

Similar to Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents

Presenty
PresentyPresenty
PresentyESUG
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinatingAntonio Goncalves
 
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
 
Five android architecture
Five android architectureFive android architecture
Five android architectureTomislav Homan
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Lorna Mitchell
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window ManagementAlive Kuo
 
Building robust apps
Building robust appsBuilding robust apps
Building robust appsCharles Neveu
 
Open Intents - Android Intents Mechanism and Dependency Management
Open Intents - Android Intents Mechanism and Dependency ManagementOpen Intents - Android Intents Mechanism and Dependency Management
Open Intents - Android Intents Mechanism and Dependency ManagementFriedger Müffke
 
Delegating user tasks in applications
Delegating user tasks in applicationsDelegating user tasks in applications
Delegating user tasks in applicationsFriedger Müffke
 
Lecture #4 activities & fragments
Lecture #4  activities & fragmentsLecture #4  activities & fragments
Lecture #4 activities & fragmentsVitali Pekelis
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveSebastian Vieira
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in ProductionRobert Sanders
 
2.1 Activities and Intents.pdf
2.1 Activities and Intents.pdf2.1 Activities and Intents.pdf
2.1 Activities and Intents.pdfSiaTeknokrat
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeterMikael Kundert
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intentsVitali Pekelis
 

Similar to Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents (20)

Presenty
PresentyPresenty
Presenty
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinating
 
Android101
Android101Android101
Android101
 
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
 
Five android architecture
Five android architectureFive android architecture
Five android architecture
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
Griffon demo
Griffon demoGriffon demo
Griffon demo
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
Hello android
Hello androidHello android
Hello android
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window Management
 
Building robust apps
Building robust appsBuilding robust apps
Building robust apps
 
Open Intents - Android Intents Mechanism and Dependency Management
Open Intents - Android Intents Mechanism and Dependency ManagementOpen Intents - Android Intents Mechanism and Dependency Management
Open Intents - Android Intents Mechanism and Dependency Management
 
Delegating user tasks in applications
Delegating user tasks in applicationsDelegating user tasks in applications
Delegating user tasks in applications
 
Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Lecture #4 activities & fragments
Lecture #4  activities & fragmentsLecture #4  activities & fragments
Lecture #4 activities & fragments
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspective
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in Production
 
2.1 Activities and Intents.pdf
2.1 Activities and Intents.pdf2.1 Activities and Intents.pdf
2.1 Activities and Intents.pdf
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeter
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
 

More from Droidcon Berlin

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google castDroidcon Berlin
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility Droidcon Berlin
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_backDroidcon Berlin
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86Droidcon Berlin
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Droidcon Berlin
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkraussDroidcon Berlin
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014Droidcon Berlin
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidconDroidcon Berlin
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devicesDroidcon Berlin
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradioDroidcon Berlin
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon Berlin
 

More from Droidcon Berlin (20)

Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google cast
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
crashing in style
crashing in stylecrashing in style
crashing in style
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility
 
Details matter in ux
Details matter in uxDetails matter in ux
Details matter in ux
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_back
 
droidparts
droidpartsdroidparts
droidparts
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86
 
5 tips of monetization
5 tips of monetization5 tips of monetization
5 tips of monetization
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkrauss
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidcon
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicro
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents

  • 1. OpenIntents www.OpenIntents.org ANDROID FUNDAMENTALS REVISITED @_zero zero@openintents.biz
  • 2. OpenIntents OpenIntents www.OpenIntents.org ● Founded in 2009 ● Open Source based Company ● Two times winners of Google Android Developer Challenge ● Over 15 Apps in the Market (Free + Paid ) ● Services: ● Reusable components ● Intents Registry ● Developer Support ● Consulting ● App Development ● Mentoring organization in Summer of Code 2011
  • 3.
  • 4. OpenIntents www.OpenIntents.org Topics ● Activity Lifecycle ● Activity Manager ● Concepts ● Components ● Why there is no App ● Permissions ● Gingerbread
  • 5.
  • 6.
  • 7. OpenIntents www.OpenIntents.org Who you're gonna call ?
  • 8. OpenIntents www.OpenIntents.org Activities ActivityManagerService
  • 9. OpenIntents www.OpenIntents.org ActivityManagerService ● Project: frameworks/base.git ● Package: com.android.server.am ● Pure Java ● Started by SystemServer, running as system process ● Creates the System Context ● Keeps a reference of the Home Screen / Launcher App
  • 10. OpenIntents www.OpenIntents.org What does ActivityManagerService do ? ● Start, stop, pause,... Activities ● Start, stop, pause,... Services ● Start, stop, pause,... ContentProviders ● Check Permission ● Broadcast Intents ● Start, stop, pause,... Animations ● Decide window focus ● Deliver Hardware Events ● Crash Activities
  • 11. OpenIntents www.OpenIntents.org What does ActivityManagerService do ? EVERYTHING
  • 12. OpenIntents www.OpenIntents.org What does ActivityManagerService do ? EVERYTHING the window manager doesn't
  • 13. OpenIntents www.OpenIntents.org What does ActivityManagerService do ? EVERYTHING the window manager doesn't (ok, almost)
  • 14. OpenIntents www.OpenIntents.org Starting an Activity ● startActivity is called (calls startActivity(Intent, -1) ● ActivityManagerNative.startActivity(..) ● Call gets dispatched via AIDL Binder to ActivityManagerService ● Call is queued in a Handler Message Queue ● startActivityXX is called ● startActivityLocked is called
  • 15. OpenIntents www.OpenIntents.org Starting an Activity ● Class is resolved ● Permission check ● Inform Watchers ● Create HistoryRecord ● Check launch Flags ● Create Task or add to existing ● Grant Permissions
  • 16. OpenIntents www.OpenIntents.org Starting an Activity ● Add to History Stack ● Prepare Animations ● Add to WindowManager (creates window) ● Pause currently running Activities ● Switch Visibility ● Calculate & update Configuration (may trigger reset) ● Resume (make call across Binder into Activity Thread) ● Set Focus ● Ensure visibility
  • 23.
  • 24. OpenIntents www.OpenIntents.org Changes in Gingerbread ● HistoryRecord renamed to ActivityRecord ● Introduction of Heavyweight Process ● Only one at any given time ● Parts of lifecycle management moved to ActivityStack ● Hardware Event / Key input was re-written ● WindowManager now has an extra “secure” layer ● ... ● Beautified comments :)