May 2014
Intermediate to advanced
280 pages
6h 27m
English
Android provides the Service component to run operations that are invisible to the user or that should be exposed to other applications. This chapter focuses on asynchronous execution with Service, although it is not an asynchronous execution environment by itself. The Service runs in the UI thread, so it can degrade responsiveness and cause ANRs, even though it does not interact directly with the UI. Still, the Service in combination with an asynchronous executor is a powerful tool for background task execution.
Two risks are inherent in using regular threads instead of services for background operation:
Read now
Unlock full access