[Britt Barak] When your app’s asleep

[Britt Barak] When your app’s asleep

Presentation from GDG DevFest Ukraine 2017 - the biggest community-driven Google tech conference in the CEE.

Learn more at: https://devfest.gdg.org.ua

3a6de6bc902de7f75c0e753b3202ed52?s=128

Google Developers Group Lviv

October 13, 2017
Tweet

Transcript

  1. When your app’s asleep Britt Barak DevFest Ukraine Oct 2017

  2. None
  3. Avg ~2 minutes/day

  4. OR 23 hours and 58 minutes unuse

  5. Being minded to UX When your app is asleep.

  6. Britt Barak Android Lead Android Academy TLV Women Techmakers IL

  7. Let’s begin!

  8. Notification

  9. We love them! 125% higher retention 88% more engagement

  10. We hate them! #1 for uninstalls 52% are annoyed

  11. How to make users love your notifications?

  12. 1. Be relevant How to make users love your notifications?

  13. BigPicture(16+) new Notification.BigPictureStyle() setStyle() BigText(16+) new Notification.BigTextStyle()

  14. Inbox(16+) new Notification.InboxStyle() setStyle() Messaging(24+) new Notification.MessagingStyle("Me")

  15. Media (21+) setStyle()

  16. Background Color (26+) "ongoing tasks which are critical for a

    user to see at a glance" builder.setColor() Understand the context
  17. • Progressbar Understand the context

  18. • Heads-Up (21+) Understand the context • 25- : ◦

    high priority ◦ ringtone / vibration • 26+: high importance channel
  19. None
  20. How does it sort? 26+: NotificationChannel metadata: importance 25-: NotificationCompat.Builder.

    • setCategory() defines behaviour when device is in Priority mode • setPriority() PRIORITY_MAX / PRIORITY_HIGH + sound / vibration = enables HeadsUp • addPerson()
  21. 1. Be relevant 2. Be useful How to make users

    love your notifications?
  22. 2.1. Actions (19+) notificationBuilder.addAction() Be Useful

  23. None
  24. 2.2. Direct reply (24+) Notification.Action.addRemoteInput() Useful notifications

  25. 2.4. TimeOut (26+) Useful notifications setTimeoutAfter()

  26. 2.5. Snoozing (26+) Useful notifications

  27. ...Things got messy

  28. 40% opt out 70% reason for uninstall

  29. 1. Be relevant 2. Be useful 3. Be focused How

    to make users love notifications?
  30. 1. Bundling (24+) Builder.setGroup() Be focused

  31. It wasn’t enough...

  32. 2. Channels (26+) Must! Notification.Builder() / setChannelId() Be focused

  33. The Power To The Users! • Importance • Sound •

    Lights • Vibration • Show on lockscreen • Override do not disturb
  34. NotificationChannel channel = new NotificationChannel(id, name, importance); channel.setDescription(description); // ...

    notificationManager .createNotificationChannel(channel);
  35. 3. Grouping (26+) Manage channel per account (group) Be focused

  36. notificationManager. createNotificationChannelGroup( new NotificationChannelGroup(id, name));

  37. 4. Notification Dot / Badge (26+) Be focused

  38. 4. Notification Dot / Badge (26+) • channel.setShowBadge() • notificationBuilder.setNumber();

    Be focused
  39. Launcher Icon

  40. Adaptive Icons (26+) Be pretty

  41. Background 108 dp = 72 + 18 + 18 dp

    Must be opaque
  42. Foreground 108 dp = 72 + 18 + 18 dp

    Can have transparency
  43. Mask Provided by the OEM

  44. Visible icon for the user (72dp) (48dp)

  45. Visible icon for the user (72dp) (48dp)

  46. Visible icon for the user (72dp) (48dp)

  47. Visible icon for the user (72dp) (48dp)

  48. <adaptive-icon> <background android:drawable=[drawable|mipmap|color]/> <foreground android:drawable=[drawable|mipmap|color]/> </adaptive-icon> /anydpi-v26/ic_launcher.xml

  49. There’s no second chance for first impression

  50. 29% close the app immediately if can’t find what they’re

    looking for
  51. App Shortcuts (25+) Be Quick

  52. Static Shortcuts

  53. AndroidManifest.xml <activity ...> <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" /> Static Shortcuts

  54. shortcuts.xml <shortcut android:shortcutId="..." android:icon="..." android:shortcutShortLabel="..."> <intent ... /> <!-- more

    intents... --> <categories android:name="android.shortcut.conversation" /> </shortcut> Static Shortcuts
  55. Dynamic Shortcuts

  56. ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "id1")

    //... .build(); Dynamic Shortcuts shortcutManager. setDynamicShortcuts(Arrays.asList(shortcut));
  57. Pinned Shortcuts (26+) Be Quick

  58. None
  59. Pinned Shortcuts if (shortcutManager.isRequestPinShortcutSupported()) { }

  60. Pinned Shortcuts if (shortcutManager.isRequestPinShortcutSupported()) { Intent pinIntent = shortcutManager.createShortcutResultIntent(shortcutInfo); PendingIntent

    onPinnedIntent = PendingIntent.getBroadcast(context, 0, pinIntent, 0); }
  61. Pinned Shortcuts if (shortcutManager.isRequestPinShortcutSupported()) { Intent pinIntent = shortcutManager.createShortcutResultIntent(shortcutInfo); PendingIntent

    onPinnedIntent = PendingIntent.getBroadcast(context, 0, pinIntent, 0); shortcutManager. requestPinShortcut(shortcutInfo, onPinnedIntent.getIntentSender()); }
  62. Be Quick 3. Quick Settings Tile (25+)

  63. None
  64. • STATE_ACTIVE • STATE_INACTIVE • STATE_UNAVAILABLE Tile States

  65. MyTileService extends TileService { } MyTileService.java

  66. • onTileAdded() • onStartListening() • onClick() • onStopListening() • onTileRemoved()

    Tile Lifecycle → on the Main Thread.
  67. @Override public void onStartListening() { Tile tile = getQsTile(); }

    MyTileService.java
  68. @Override public void onStartListening() { Tile tile = getQsTile(); //...

    tile.setState(Tile.STATE_ACTIVE); tile.updateTile(); } MyTileService.java
  69. <service ... android:permission= "android.permission.BIND_QUICK_SETTINGS_TILE"> <intent-filter> <action android:name= "android.service.quicksettings.action.QS_TILE"/> </intent-filter> </service>

    AndroidManifest.xml
  70. What can it do? • showDialog() - adding context to

    your action. a. b. c. There are some limitations when it comes to a locked device though. When isLocked() returns true, you won’t be able to display a dialog and activities must have set FLAG_SHOW_WHEN_LOCKED to display above the lock screen. The unlockAndRun() method can be used to prompt the user to unlock their device, allowing you to run code (such as displaying a dialog) only after they’ve unlocked their device. startActivityAndCollapse
  71. Users must love you on background as much as they

    do on the foreground
  72. Users must love u on the background... - Be relevant

    - Notifications styles - Be useful - Notification actions & reply - Be focused - Channels - Notif. badge - Be pretty - Adaptive icons - Be quick - Shortcuts - Quick settings tile
  73. Get my notes on - @britt.barak Keep in touch! Britt

    Barak @brittBarak Thank you!
  74. Thank You !

  75. 2.3. Smart reply (24+, wear) addHistoricMessage(26+) Useful notifications