Android has a number of requirements around events delivered from the user interface that are important to be aware of, because they directly affect the user's experience and the perceived performance of your application. Android runs the main thread of an application as an event loop, rather than having a separate event loop or event dispatcher thread. This is an extremely important concept to understand, because this thread and event queue are shared between the following:
- All the events from the user interface
- The drawing requests from the widgets, where they paint themselves
- The layout system and all the calculations for positioning and sizing widget
- A variety of system-level events (such as network state changes)
This makes the main thread of the application a precious resource--every frame of an animation has to run through...