Download presentation
Presentation is loading. Please wait.
Published byRoy Curtis Modified over 9 years ago
1
Android activities 1 CS300
2
What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents: message-passing framework Broadcast receivers: broadcast consumers Widgets: components added to home screen Notifications: signa users without interrupting their current activities CS300 2
3
3
4
Activity states Foreground of the screen: active or running. At top of stack Lost focus but still visible: paused. A paused activity is completely alive, but can be killed by the system in extreme low memory situations. Completely obscured by another activity: stopped. Retains all state and member information, however, it is no longer visible to the user If paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. CS300 4
5
Configuration changes It will cause your current activity to be destroyed going through the normal activity lifecycle process of onPause(), onStop(), and onDestroy() as appropriate.onPause()onStop()onDestroy() If the activity had been in the foreground or visible to the user, once onDestroy() is called in that instance then a new instance of the activity will be created, with whatever savedInstanceState the previous instance had generated from onSaveInstanceState(Bundle).onDestroy()onSaveInstanceState(Bundle) CS300 5
6
AndroidManifest.xml heart of the (structure of) android app lists out all the modules of your android application CS300 6
7
What does the manifest do?? Identify any user permissions the application requires, such as Internet access or read-access to the user's contacts. Declare the minimum API Level required by the application, based on which APIs the application uses.API Level Declare hardware and software features used or required by the application, such as a camera, bluetooth services, or a multitouch screen. API libraries the application needs to be linked against (other than the Android framework APIs), such as theGoogle Maps library.Google Maps library 7
8
What does the manifest do?? The primary task of the manifest is to inform the system about the application's components You must declare all application components this way: elements for activities elements for services elements for broadcast receivers elements for content providers CS300 8
9
Resources http://developer.android.com/reference/android/ app/Activity.html http://developer.android.com/reference/android/ app/Activity.html http://developer.android.com/guide/components/f undamentals.html http://developer.android.com/guide/components/f undamentals.html http://developer.android.com/guide/topics/manife st/manifest-intro.html http://developer.android.com/guide/topics/manife st/manifest-intro.html CS300 9
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.