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

Turbo Charging Your Android Notifications

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.

Juan Gomez

February 04, 2015
Tweet

More Decks by Juan Gomez

Other Decks in Technology

Transcript

  1. Turbo Charging Your Android
    Notifications
    Juan Gomez

    View Slide

  2. Intro
    Who am I?
    • Mobile Engineer at Eventbrite
    • Previously at OneLouder Apps
    • Android & Python Developer

    View Slide

  3. Why notifications?

    View Slide

  4. Anatomy of a Notification

    View Slide

  5. Building a simple notification

    View Slide

  6. Issuing the notification

    View Slide

  7. Expanded layouts

    View Slide

  8. Actions

    View Slide

  9. Building an expanded
    notification

    View Slide

  10. Issuing the notification

    View Slide

  11. Inbox style notifications

    View Slide

  12. Building an inbox-style
    notification

    View Slide

  13. Updating the notification

    View Slide

  14. Updating the notification

    View Slide

  15. View Slide

  16. Building a picture-style
    notification

    View Slide

  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

    View Slide

  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.

    View Slide

  19. Lockscreen Visibility

    View Slide

  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.

    View Slide

  21. Notifications on Android
    Wear

    View Slide

  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.

    View Slide

  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

    View Slide

  24. Thank You!
    Twitter: @_juandg
    Email: [email protected]
    Lanyrd: lanyrd.com/profile/juandg/

    View Slide