Notifications and Services
So far, everything we've done with Android has happened visually as part of an Activity. In this chapter, we're going to venture out beyond activities and take a look at another core application component - services. Through the use of services your applications will be able to perform operations in the background long after your activity finishes and your application closes.
In working with services, we'll explore media playback and how to create applications that provide for a rich media experience. We'll talk about playing both audio and video, and we'll also delve into how you can use services to create audio experiences that don't end when your app does.
Lastly, we'll take a look at the notifications framework. In working with services, things can happen in your app long after the activity closes. Without an activity to provide feedback, we must look to other methods of alerting the user to urgent information. For this, we'll be using notifications. We'll start by creating basic notifications that simply display data, then move on to expanded notifications that allow the user to take actions on those alerts.