Chapter 36

Basic Service Patterns

Now that you have seen the pieces that make up services and their clients, let’s examine a few scenarios that employ services and how those scenarios might be implemented.

The Downloader

If you elect to download something from the Android Market, after the download begins, you are free to exit the Market application entirely. This does not cancel the download—the download and installation run to completion, despite no Android Market activity being shown onscreen.

You may have a similar scenario in your application. Perhaps you want to enable users to download a purchased e-book, download a map for a game, download a file from a “drop box” file-sharing service, or download some other type of material, and you ...

Get Beginning Android 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.