A short presentation of threading in Android, by Tobias Ekblom, developer at Appland AB. The presentation was held at the ScanDev 2012 conference in Gothenburg, Sweden.
@tobiasekblom on Twitter
2. Threading in Android
• To achieve responsivness
• All heavy work on background thread
• Updates of the ui on the ui-thread
Ui-thread
Progress Progress
Publish
update update
Background-thread
Fetching data from Server Fetching ... Done.
3. AsyncTask
• Class for threading provided by Android
• Methods
– doInBackground() Background thread
– onPostExecute() or onProgressUpdate() ui-thread
• .execute(params) !
7. Summary
• Threading – a must have for a responsive
application
• Android switching between serial and
parallell excecution
• Take control with a queue