SlideShare a Scribd company logo
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

Viewers also liked (8)

PPSX
Perception Ppt New
Dr Ramprasad Kesiraju
 
PPTX
Nokia product life cycle
Tasheen Sheikh
 
PPT
1. maggi the-product-life-cycle
Swati Sharma
 
PPTX
Product life cycle & marketing strategies
Amar Ingale
 
PPT
Product life cycle
Navneet Jingar
 
PPTX
Product life cycle of nokia mobiles
Tanmoy Roy
 
PPTX
Product life cycle & marketing strategy
Hitesh Sunny
 
PPT
Product life cycle
Vandna Dhiman
 
Perception Ppt New
Dr Ramprasad Kesiraju
 
Nokia product life cycle
Tasheen Sheikh
 
1. maggi the-product-life-cycle
Swati Sharma
 
Product life cycle & marketing strategies
Amar Ingale
 
Product life cycle
Navneet Jingar
 
Product life cycle of nokia mobiles
Tanmoy Roy
 
Product life cycle & marketing strategy
Hitesh Sunny
 
Product life cycle
Vandna Dhiman
 

Similar to iOS Application Lifecycle (20)

PPTX
Activity lifecycle
Rehan Choudhary
 
PDF
Android development Training Programme Day 2
DHIRAJ PRAVIN
 
PPTX
Presentation on Android application life cycle and saved instancestate
Osahon Gino Ediagbonya
 
PPTX
1a.Activity life cycle basics of android.pptx
BhawnaSaini45
 
PDF
02 programmation mobile - android - (activity, view, fragment)
TECOS
 
PDF
Marakana android-java developers
Marko Gargenta
 
PPTX
Lecture 6: Android Activity Life Cycle.pptx
Yousef Alamir
 
PDF
Lecture 3 getting active through activities
Ahsanul Karim
 
PPT
Activities
Sourabh Sahu
 
PDF
Mad textbook 63-116
PrathishGM
 
ODP
Anatomy of android application
Nikunj Dhameliya
 
PDF
Android life cycle
瑋琮 林
 
PPT
Android
Natasha Ramírez
 
PPTX
Android application componenets for android app development
BalewKassie
 
PDF
Inside the android_application_framework
surendray
 
PPTX
App Fundamentals and Activity life cycle.pptx
ridzah12
 
DOCX
Activity
roopa_slide
 
DOCX
Activity
NikithaNag
 
DOCX
Activity
NikithaNag
 
DOCX
Activity
roopa_slide
 
Activity lifecycle
Rehan Choudhary
 
Android development Training Programme Day 2
DHIRAJ PRAVIN
 
Presentation on Android application life cycle and saved instancestate
Osahon Gino Ediagbonya
 
1a.Activity life cycle basics of android.pptx
BhawnaSaini45
 
02 programmation mobile - android - (activity, view, fragment)
TECOS
 
Marakana android-java developers
Marko Gargenta
 
Lecture 6: Android Activity Life Cycle.pptx
Yousef Alamir
 
Lecture 3 getting active through activities
Ahsanul Karim
 
Activities
Sourabh Sahu
 
Mad textbook 63-116
PrathishGM
 
Anatomy of android application
Nikunj Dhameliya
 
Android life cycle
瑋琮 林
 
Android application componenets for android app development
BalewKassie
 
Inside the android_application_framework
surendray
 
App Fundamentals and Activity life cycle.pptx
ridzah12
 
Activity
roopa_slide
 
Activity
NikithaNag
 
Activity
NikithaNag
 
Activity
roopa_slide
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Ad

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: