APPLICATION LIFECYCLE

APPLICATION LIFECYCLE
Slide Note
Embed
Share

The lifecycle stages of Android applications, from active to inactive states. Learn about callback methods, activity transitions, service lifecycle, binding methods, and more. Gain insights into managing Android components effectively.

  • Android
  • Lifecycle
  • Callback Methods
  • Activity Transition
  • Service Lifecycle

Uploaded on Feb 15, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. 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. onRestore InstanceState Activity. onSave InstanceState Activity. onStart Activity. onResume Activity. onPause Activity. onStop Activity. onCreate Activity. 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. onCreate Service. Service. onDestroy onStartCommand Service. onBind Service. 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 Foreground process 2. Visible process Service process 4. Background process 5. Empty process 1. 3.

  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:

  14. iOS Application launch

  15. iOS Transition to background

  16. iOS Return to foreground

  17. iOS Interruption handling UIKit Delegate Active Phone, SMS, or Calendar notification arrives applicationWillResignActive: Ignore ? Yes applicationDidBecomeActive: No Application moves to background applicationDidEnterBackground:

  18. iOS 4 Application lifecycle application:didFinishLaunchingWithOptions: applicationDidBecomeActive: Ignore interrupt Active applicationWillEnterForeground: applicationWillResignActive: applicationDidEnterBackground: Suspended applicationWillTerminate:

  19. Reminder Proposal due Wednesday

More Related Content