SlideShare a Scribd company logo
1 of 19
APPLICATION LIFECYCLE
Application lifecycles

 Applications and processes may transition
  between several states
   active
   paused
   stopped
   inactive
   suspended
 Callback methods allow applications to
  prepare for and respond to transitions
Android lifecycle methods

 Lifecycle state transitions trigger event
  callback methods
 Callback events differ based on type of
  component
 Callback methods take place in foreground
  and should be brief
Android Activity


                           Activity.                       Activity.
            Activity.                    Activity.                      Activity.   Activity.
                          onRestore                        onSave
            onStart                     onResume                        onPause     onStop
                        InstanceState                   InstanceState
Activity.                                                                                        Activity.
onCreate                                                                                        onDestroy




                                                          Activity.
                                                         onRestart




                                                     Active lifetime

                                                     Visible lifetime

                                                      Full lifetime
                                                                                        Application is
                                                                                        killable
Activity callback methods

 Implementation of lifecycle method should
  always first call superclass

         protected void onPause() {
             super.onPause();
             . . .
         }
Activity transition
     Activity A   Activity B

     ActivityA.
     onPause
                  ActivityB.
                  onCreate

                  ActivityB.
                   onStart

                  ActivityB.
                  onResume
     ActivityA.
      onStop
Android Service

Service.       Service.                               Service.
onCreate   onStartCommand                            onDestroy




                  Service.                Service.
                  onBind                 onUnbind



                              Service.
                             onRebind
Service binding methods
        Activity           Service


      bindService()

                           .onBind()
   ServiceConnection.
   onServiceConnected



     unbindService()

                          .onUnbind()
    ServiceConnection.
  onServiceDisconnected
Android BroadcastReceiver


                BroadcastReceiver.
                    onReceive




 Only active while handling onReceive()
  method
Android ContentProvider

                  ContentProvider.
                     onCreate



 Only active while handling methods
  supporting ContentResolver
     query()
     insert()
     update()
     delete()
     getType()
Processes and lifecycles

 Old processes removed when memory runs
  low
 Selection base on importance hierarchy
  1.   Foreground process
  2.   Visible process
  3.   Service process
  4.   Background process
  5.   Empty process
iOS Application lifecycle

 UIApplication notified of state transition
  events
   Handled by application delegate
     application:didFinishLaunchingWithOptions:
     applicationDidBecomeActive:
     applicationWillResignActive:
     applicationDidEnterBackground:
     applicationWillEnterForeground:
     applicationWillTerminate:
Pre – iOS 4

      application:didFinishLaunchingWithOptions:



             applicationDidBecomeActive:



                        Active



              applicationWillTerminate:
iOS Application launch
iOS Transition to background
iOS Return to foreground
iOS Interruption handling
          UIKit                      Delegate


         Active



 Phone, SMS, or Calendar
                            applicationWillResignActive:
   notification arrives


         Ignore     Yes     applicationDidBecomeActive:
            ?
        No
  Application moves to
                           applicationDidEnterBackground:
      background
iOS 4 Application lifecycle
      application:didFinishLaunchingWithOptions:



             applicationDidBecomeActive:


  Ignore
interrupt               Active              applicationWillEnterForeground:



             applicationWillResignActive:



            applicationDidEnterBackground:
                                                         Suspended


               applicationWillTerminate:
Reminder

 Proposal due Wednesday

More Related Content

What's hot

Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
mfrancis
 

What's hot (20)

Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
 
Angular
AngularAngular
Angular
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsSetting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.
 
Introduction to jest
Introduction to jestIntroduction to jest
Introduction to jest
 
Why Should we use Microsoft's Playwright
Why Should we use Microsoft's PlaywrightWhy Should we use Microsoft's Playwright
Why Should we use Microsoft's Playwright
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
Selenium WebDriver com Docker
Selenium WebDriver com DockerSelenium WebDriver com Docker
Selenium WebDriver com Docker
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
What Is Java | Java Tutorial | Java Programming | Learn Java | Edureka
What Is Java | Java Tutorial | Java Programming | Learn Java | EdurekaWhat Is Java | Java Tutorial | Java Programming | Learn Java | Edureka
What Is Java | Java Tutorial | Java Programming | Learn Java | Edureka
 
Kotlin on android
Kotlin on androidKotlin on android
Kotlin on android
 
Lessons Learned from Using Next.js in Production
Lessons Learned from Using Next.js in ProductionLessons Learned from Using Next.js in Production
Lessons Learned from Using Next.js in Production
 
Docker Container Introduction
Docker Container IntroductionDocker Container Introduction
Docker Container Introduction
 
Nodejs
NodejsNodejs
Nodejs
 
Eclipse - Installation and quick start guide
Eclipse - Installation and quick start guideEclipse - Installation and quick start guide
Eclipse - Installation and quick start guide
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Pros & cons of svelte
Pros & cons of sveltePros & cons of svelte
Pros & cons of svelte
 

Viewers also liked (10)

Android Application Development at JFokus 2011
Android Application Development at JFokus 2011Android Application Development at JFokus 2011
Android Application Development at JFokus 2011
 
Perception Ppt New
Perception Ppt NewPerception Ppt New
Perception Ppt New
 
Nokia product life cycle
Nokia product life cycleNokia product life cycle
Nokia product life cycle
 
1. maggi the-product-life-cycle
1. maggi the-product-life-cycle1. maggi the-product-life-cycle
1. maggi the-product-life-cycle
 
Product life cycle & marketing strategies
Product life cycle & marketing strategiesProduct life cycle & marketing strategies
Product life cycle & marketing strategies
 
Product life cycle
Product life cycleProduct life cycle
Product life cycle
 
Product life cycle of nokia mobiles
Product life cycle of nokia mobilesProduct life cycle of nokia mobiles
Product life cycle of nokia mobiles
 
Product Life Cycle Management
Product Life Cycle ManagementProduct Life Cycle Management
Product Life Cycle Management
 
Product life cycle & marketing strategy
Product life cycle & marketing strategyProduct life cycle & marketing strategy
Product life cycle & marketing strategy
 
Product life cycle
Product life cycleProduct life cycle
Product life cycle
 

Similar to iOS Application Lifecycle

11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
MugiiiReee
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
Hussain Behestee
 
Android development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2
DHIRAJ PRAVIN
 
Advanced android app lifecycle + Patterns
Advanced android app lifecycle + PatternsAdvanced android app lifecycle + Patterns
Advanced android app lifecycle + Patterns
bryan costanich
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developers
Marko Gargenta
 

Similar to iOS Application Lifecycle (20)

Introduction toandroid
Introduction toandroidIntroduction toandroid
Introduction toandroid
 
Android101
Android101Android101
Android101
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
 
Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)
 
App anatomy and life cycle
App anatomy and life cycleApp anatomy and life cycle
App anatomy and life cycle
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
 
Introduction to Handoff
Introduction to HandoffIntroduction to Handoff
Introduction to Handoff
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
 
Android Component.pptx
Android Component.pptxAndroid Component.pptx
Android Component.pptx
 
Android
AndroidAndroid
Android
 
Android Training (Services)
Android Training (Services)Android Training (Services)
Android Training (Services)
 
Mad textbook 63-116
Mad textbook 63-116Mad textbook 63-116
Mad textbook 63-116
 
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 development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2
 
Delegateless Coordinators - take 2
Delegateless Coordinators - take 2Delegateless Coordinators - take 2
Delegateless Coordinators - take 2
 
Advanced android app lifecycle + Patterns
Advanced android app lifecycle + PatternsAdvanced android app lifecycle + Patterns
Advanced android app lifecycle + Patterns
 
Marakana android-java developers
Marakana android-java developersMarakana android-java developers
Marakana android-java developers
 
Hieu Xamarin iOS9, Android M 3-11-2015
Hieu Xamarin iOS9, Android M  3-11-2015Hieu Xamarin iOS9, Android M  3-11-2015
Hieu Xamarin iOS9, Android M 3-11-2015
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

iOS Application Lifecycle

  • 2. Application lifecycles  Applications and processes may transition between several states  active  paused  stopped  inactive  suspended  Callback methods allow applications to prepare for and respond to transitions
  • 3. Android lifecycle methods  Lifecycle state transitions trigger event callback methods  Callback events differ based on type of component  Callback methods take place in foreground and should be brief
  • 4. Android Activity Activity. Activity. Activity. Activity. Activity. Activity. onRestore onSave onStart onResume onPause onStop InstanceState InstanceState Activity. Activity. onCreate onDestroy Activity. onRestart Active lifetime Visible lifetime Full lifetime Application is killable
  • 5. Activity callback methods  Implementation of lifecycle method should always first call superclass protected void onPause() { super.onPause(); . . . }
  • 6. Activity transition Activity A Activity B ActivityA. onPause ActivityB. onCreate ActivityB. onStart ActivityB. onResume ActivityA. onStop
  • 7. Android Service Service. Service. Service. onCreate onStartCommand onDestroy Service. Service. onBind onUnbind Service. onRebind
  • 8. Service binding methods Activity Service bindService() .onBind() ServiceConnection. onServiceConnected unbindService() .onUnbind() ServiceConnection. onServiceDisconnected
  • 9. Android BroadcastReceiver BroadcastReceiver. onReceive  Only active while handling onReceive() method
  • 10. Android ContentProvider ContentProvider. onCreate  Only active while handling methods supporting ContentResolver  query()  insert()  update()  delete()  getType()
  • 11. Processes and lifecycles  Old processes removed when memory runs low  Selection base on importance hierarchy 1. Foreground process 2. Visible process 3. Service process 4. Background process 5. Empty process
  • 12. iOS Application lifecycle  UIApplication notified of state transition events  Handled by application delegate  application:didFinishLaunchingWithOptions:  applicationDidBecomeActive:  applicationWillResignActive:  applicationDidEnterBackground:  applicationWillEnterForeground:  applicationWillTerminate:
  • 13. Pre – iOS 4 application:didFinishLaunchingWithOptions: applicationDidBecomeActive: Active applicationWillTerminate:
  • 15. iOS Transition to background
  • 16. iOS Return to foreground
  • 17. iOS Interruption handling UIKit Delegate Active Phone, SMS, or Calendar applicationWillResignActive: notification arrives Ignore Yes applicationDidBecomeActive: ? No Application moves to applicationDidEnterBackground: background
  • 18. iOS 4 Application lifecycle application:didFinishLaunchingWithOptions: applicationDidBecomeActive: Ignore interrupt Active applicationWillEnterForeground: applicationWillResignActive: applicationDidEnterBackground: Suspended applicationWillTerminate: