Professional Documents
Culture Documents
Introducing Notifications
Introducing Notifications
NOTIFICATIONS
Configuring
Notifications
• NotificationManager is available to
you through your application via
the passing of an appropriately
structured parameter to a
getSystemService() method call.
This can be as simple as the
following code snippet:
getSystemService(NOTIFICATIO
N_SERVICE)
Configuring
Notifications (cont.)
Some of the most common
methods you will use with
the NotificationManager
object are:
1. notify()
2. cancel()
3. cancelAll()
Adding Sounds to Your Notification
Lights for You can change the color of the LED, on supported
devices, via the ledARGB parameter and the matching
Your hex code for the RGB-based color you wish to use.
Notification Blink and cycle the light using the ledOnMS and
ledOffMS values, expressing on and off times in
milliseconds.
Icon Sizes for Adding icons allows you to tailor
icons to your desired level of
Different Android artistry, but there are
considerations for the various
Versions versions of Android you need to
keep in mind, as these affect the
resolution of icon images
supported.
To maximize the range of Android
devices you can support and their
related notification styles and sizes,
you should create at least four
drawables representing your icon:
A 12-pixel by 19-pixel bounding box,
Icon Sizes housing a 12-pixel square icon
for A 16-pixel by 25-pixel bounding box,
Different housing a 16-pixel square icon