Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Turbo Charging Your Android Notifications

898e54ca0e526384e3d0a4177edbb480?s=47 Juan Gomez
February 04, 2015

Turbo Charging Your Android Notifications

Android notifications are a great way to keep your users engaged with your app. And now with Android 5.0 (Lollipop) notifications are front and center on the Android platform, which means it’s even more important for you as a developer to learn how to take advantage of this very powerful Android feature.

In this class, we will take a technical deep dive into Android notifications. You will learn how to add notifications to your app, how to customize notifications to better display the information you need to present and how to take advantage of advanced features like inbox style notifications, custom layouts and custom actions. We will also explore other important aspects of Android notifications, like compatibility with previous version of Android and the possibility to extend your app’s notifications into Android Wear devices.

898e54ca0e526384e3d0a4177edbb480?s=128

Juan Gomez

February 04, 2015
Tweet

Transcript

  1. Turbo Charging Your Android Notifications Juan Gomez

  2. Intro Who am I? • Mobile Engineer at Eventbrite •

    Previously at OneLouder Apps • Android & Python Developer
  3. Why notifications?

  4. Anatomy of a Notification

  5. Building a simple notification

  6. Issuing the notification

  7. Expanded layouts

  8. Actions

  9. Building an expanded notification

  10. Issuing the notification

  11. Inbox style notifications

  12. Building an inbox-style notification

  13. Updating the notification

  14. Updating the notification

  15. None
  16. Building a picture-style notification

  17. On the lock screen • Because notifications are visible on

    the lock screen, user privacy is an especially important consideration. • Notifications often contain sensitive information, and should not necessarily be visible to anyone who picks up the device and turns on the display. • For devices that have a secure lock screen (PIN, pattern, or password), the interface has public and private parts. • The public interface can be displayed on a secure lock screen and therefore seen by anyone. The private
  18. Lockscreen Visibility • Call Notification.Builder.setVisibility(…) • VISIBILITY_PUBLIC: Shows the notification's

    full content. • VISIBILITY_PRIVATE: shows basic information about the existence of this notification • VISIBILITY_SECRET: Shows only the most minimal information, excluding even the notification's icon.
  19. Lockscreen Visibility

  20. Notifications on Android Wear • Notifications and their actions are

    bridged over to Wear devices by default. • You can control which notifications bridge from the phone to the watch, and vice-versa. • If your app includes actions that can't be accomplished with a single tap, either hide these actions on your Wear notification or consider hooking them up to a Wear app, thus allowing the user to finish the action on their watch.
  21. Notifications on Android Wear

  22. Summary • Adding notifications to your Android app is easy.

    • Take advantage of different notification styles that allow you to display more relevant information at a glance. • Extend your notifications into Android Wear and keep your users engaged by displaying information on their Smartwatch.
  23. Useful links • http://developer.android.com/guide/topics/ui/ notifiers/notifications.html • http://developer.android.com/reference/android/ app/Notification.html • http://www.youtube.com/watch?v=Yc8YrVc47TI

  24. Thank You! Twitter: @_juandg Email: jgomez@eventbrite.com Lanyrd: lanyrd.com/profile/juandg/