Download presentation
Presentation is loading. Please wait.
Published byVeronica Sims Modified over 8 years ago
1
Android intro Building UI #1: interactions
2
AndroidManifest.xml permissions 2
3
Application Global entry point (*except ContentProvider) Per-process singleton Activity.getApplication() Service.getApplication() Context.getApplicationContext() (+cast) 3
4
Service Long-running off-UI tasks Runs in UI thread Must be stopped =>IntentService to the rescue! (check sources) Often used with AlarmManager for scheduled operations Might be bound to Activity lifecycle 4
5
BroadcastReceiver onReceive() React to some intents Broadcast to all receivers Special case – OrderedBroadcast Static in manifest or dynamic via registerReceiver/unregisterReceiver 5
6
Activity - extras getIntent().getXXXExtra() Bundle b = getIntent().getExtras() Bundle.getString() Bundle.putString()/putInt()/etc startActivityForResult()/onResult() 6
7
Activity - lifecycle onCreate()/onDestroy() (*not guaranteed) onResume()/onPause() onStart()/onStop() onConfigurationChanged() onSaveInstanceState() https://github.com/xxv/android-lifecycle 7
8
Homework – translator app Enter word screen Results screen (with option to re-query) EditText Spinner->TextView+ListView+BaseAdapter AsyncTask! 8
9
AsyncTask doInBackground()/onPostExecute() onPreExecute() Not bound to lifecycle (fixed in loaders) Callback-based (don’t use.get()!) 9
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.