Android Tutorial

(avery) #1
Android Tutorial 411

Working with Notifications

Applications often need to communicate with the user even when
the application isn’t actively running. Applications can alert users
with text notifications, vibration, blinking lights, and even audio. In
this chapter, you learn how to build different kinds of notifications
into your Android applications.

Notifying the User

Applications can use notifications to greatly improve the user’s
experience. For example:

 An email application might notify a user when new messages arrive. A
news reader application might notify a user when there are new articles to
read.
 A game might notify a user when a friend has signed in, or sent an
invitation to play, or beat a high score.
 A weather application might notify a user of special weather alerts.
 A stock market application might notify the user when certain stock price
targets are met. (Sell now! Before it’s too late!)

Users appreciate these notifications because they help drive
application workflow, reminding the users when they need to
launch the application. However, there is a fine line between just
enough and too many notifications. Application designers need to
consider carefully how they should employ the use of notifications
so as not to annoy the user or interrupt them without good reason.
Each notification should be appropriate for the specific application
and the event the user is being notified of For example, an
application should not put out an emergency style notification
(think flashing lights, ringing noises, and generally making a “to-
Free download pdf