1 / 9

Android activities

Android activities. 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

suzuki
Télécharger la présentation

Android activities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android activities 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

  3. CS300

  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

  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. • 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). CS300

  6. AndroidManifest.xml • heart of the (structure of) android app • lists out all the modules of your android application CS300

  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. • 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.

  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: • <activity> elements for activities • <service> elements for services • <receiver> elements for broadcast receivers • <provider> elements for content providers CS300

  9. Resources • http://developer.android.com/reference/android/app/Activity.html • http://developer.android.com/guide/components/fundamentals.html • http://developer.android.com/guide/topics/manifest/manifest-intro.html CS300

More Related