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

Android notifications - What's new in Android L...

Android notifications - What's new in Android Lollipop

Talk given in this form at the Google devfest of the Dutch Android User Group and the Google Developers Group, Netherlands.

A slightly different version of this talk was given Oct, 26th 2014 at the devfest of the GDG, Düsseldorf.

Wolfram Rittmeyer

November 08, 2014
Tweet

More Decks by Wolfram Rittmeyer

Other Decks in Programming

Transcript

  1. Heads Up Notifications • Are less intrusive than old way

    • Yet still annoying enough to not go unnoticed • For the most pressing notifications
  2. Android Wear • Mirrors notifications of device • Well, kind

    of – it's actually more flexible than that • For stuff that is important now
  3. User is in Control • User can disable all notifications

    for specific apps • User can define periods of „Downtime“ – Only priority notifications will go through – Only users can elevate apps to priority apps • Users can opt out of Lockscreen Notifications
  4. User is in Control • User can go there either

    from the settings • Or when long-clicking your notification:
  5. Always set the content intent • That's the intent that

    gets fired when the user clicks your Notification • Users expect notifications to be clickable • Not required, but necessary :-)
  6. PendingIntents • Independent of app lifecycle • Allows other apps

    to use your permissions • Key is combined of: – Intent (without Extras!) – Requestcode • Use correct flags – Most often FLAG_UPDATE_CURRENT
  7. Updating notifications • Android updates when ID is the same

    • Important for – Actions – Persistent notifications • To avoid flicker: builder.setWhen(naturalTimestamp) • Consider adding this line: builder.setOnlyAlertOnce(true);
  8. Priority • HIGH or MAX -> Heads up notification •

    MIN -> no small icon will be displayed – Don't use sound, light or vibration! • LOW -> small icon will be displayed – Don't use sound, light or vibration! • DEFAULT – Documentation recommends to use light and sound • Ranking in Lollipop more complex than before
  9. Big Styles • BigPictureStyle • BigTextStyle • InboxStyle – Doesn't

    work great on Wear – Use stacked notifications on Wear instead • MediaStyle – New in Lollipop
  10. Visibility • Important for lockscreen notifications – VISIBILITY_PUBLIC • Android

    displays everything – VISIBILITY_PRIVATE • Is the default level • Android displays the icon and the ticker text – VISIBILITY_SECRET • Android shows nothing on the lockscreen • builder.setVisibility(VISIBILITY_PUBLIC) • Consider setPublicVersion()
  11. PITA • Always consider the „Pain in the A**“ level

    • Notifications are attracting the user's attention • Thus they are always distracting • MIN do not show an icon – The only one without any PITA attached – Use them whenever possible and appropriate Her
  12. Ticker text • Is very distracting • Only use it

    if the user cares about it now – The user's favorite club scored: Yes – Some other club scored: No
  13. LED colors • Just leave them white • The user

    doesn't know your color anyway • If at all, let the user select a color
  14. Icon colors • Leave them white! • I mean it:

    Leave them white! • This is a horrible mess:
  15. Priority • Do not use a higher priority to improve

    ranking • Consider the importance for the user only
  16. Give the user control • Provide settings for notifications •

    Let them disable them completely • Let them control the PITA level – Color, sound, vibration, priority, frequency
  17. Make them a benefit „Notifications embody your app's voice, and

    contribute to your app's personality“ https://developer.android.com/design/patterns/notifications.html