Android Tutorial

(avery) #1

By : Ketan Bhimani


424 

providing a themed or branded appearance.

Note

The default layout includes two fields of text: an icon and a time
field for when the notification was triggered. Users are accustomed
to this information. An application, where feasible and where it
makes sense, should try to conform to at least this level of
information when using custom notifications.

Designing Useful Notifications

As you can see, the notification capabilities on the Android platform
are quite robust—so robust that it is easy to overdo it and make
your application tiresome for the user. Here are some tips for
designing useful notifications:

 Only use notifications when your application is not in the foreground. When
in the foreground, use Toast or Dialog controls.
 Allow the user to determine what types (text, lights, sound, vibration) and
frequency of notifications she will receive, as well as what events to trigger
notifications for.
 Whenever possible, update and reuse an existing notification instead of
creating a new one.
 Clear notifications regularly so as not to overwhelm the user with dated
information.
 When in doubt, generate “polite” notifications (read: quiet).
 Make sure your notifications contain useful information in the ticker, title,
and body text fields and launch sensible intents.

The notification framework is lightweight yet powerful. However,
some applications such as alarm clocks or stock market monitors
might also need to implement their own alert windows above and
beyond the notification framework provided. In this case, they may
use a background service and launch full Activity windows upon
Free download pdf