• Save
iOS Application Lifecycle
Upcoming SlideShare
Loading in...5
×
 

iOS Application Lifecycle

on

  • 8,109 views

 

Statistics

Views

Total Views
8,109
Views on SlideShare
7,967
Embed Views
142

Actions

Likes
2
Downloads
0
Comments
0

3 Embeds 142

http://ditapps.wordpress.com 107
https://twitter.com 34
http://www.verious.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    iOS Application Lifecycle iOS Application Lifecycle Presentation Transcript

    • 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 InstanceStateActivity. 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 ServiceService. 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: Ignoreinterrupt Active applicationWillEnterForeground: applicationWillResignActive: applicationDidEnterBackground: Suspended applicationWillTerminate:
    • Reminder Proposal due Wednesday