android activities 1 cs300. what makes an app? activities: presentation layer services: invisible...
TRANSCRIPT
![Page 1: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/1.jpg)
1
CS300
Android activities
Click icon to add picture
![Page 2: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/2.jpg)
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
![Page 3: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/3.jpg)
CS3003
![Page 4: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/4.jpg)
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.
![Page 5: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/5.jpg)
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).
![Page 6: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/6.jpg)
CS300
6
AndroidManifest.xml
heart of the (structure of) android app lists out all the modules of your android
application
![Page 7: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/7.jpg)
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.
![Page 8: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/8.jpg)
CS300
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
![Page 9: Android activities 1 CS300. What makes an app? Activities: presentation layer Services: invisible workers Content Providers: databases Intents:](https://reader035.vdocuments.us/reader035/viewer/2022071806/56649d005503460f949d2ee5/html5/thumbnails/9.jpg)
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