Professional Documents
Culture Documents
Wk5 - MVC and Threads
Wk5 - MVC and Threads
Discipline of IT
James Cook University
1
This presentation focuses on…
1. Android Threads
2. MVC in Android
3. Graphics in Android
2
Handling background tasks
• Common issues:
• Updating a GUI object from a background
task will crash the App!
• Running task that take a long time on the
GUI thread slows the program down
Using Threads directly
• View.postInvalidate()
Why use MVC?
• Useful classes
– Canvas (support draw and transformations)
– Paint
– Bitmap
– Drawable – you can setup drawable objects (i.e.
shapes)
Bling
• Animation
– You can implement “tweening”
» Provide start, end, and speed to change visual
attirubtes
• Size, position, scale, color…
MVC – This is the way to make an app in Android
19