Chapter 6. Long-running Tasks with Service
In Chapter 5, Queuing Work with IntentService, we learned about a specialized subclass of Service
that handles its workload on a single background thread.
In this chapter, we'll extend our toolkit by directly extending Service
to take control of the level of concurrency applied to our long-running background tasks—how many threads are used to perform the work—and use various methods to send work to Services and receive results from them.
In this chapter, we will cover the following topics:
Building responsive apps with
Service
Controlling concurrency with Executors
Returning results with
Messenger
Direct communication with local Services
Broadcasting results with Intents
Detecting unhandled broadcasts
Applications of Services