O'Reilly logo

Creating Android Applications: Develop and Design by Chris Haseman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6. The Way of the Service

Services are one of the most important, and often under-utilized, components of the Android platform. They are essential for accomplishing any task whose data or relevance can span more than one activity. They are like activities in that they have a lifecycle (albeit a much simpler one), but they do not have the activity’s ability to draw to the screen. In practice, services break down into two major use cases: the listener and the task. Listeners are services that hang out in the background, waiting for something to happen that prompts them to take action. Task services are akin to the photo downloader that we covered before, so in this chapter I’ll focus on listening services.

What Is a Service?

A Service is, at its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required