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

iQONのWear Notification最適化

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

iQONのWear Notification最適化

2014年8月28日にグーグル株式会社で行われた「Android Wear Bootcamp」で登壇した際のスライド

Avatar for Yoichi Nishimura

Yoichi Nishimura

August 28, 2014
Tweet

More Decks by Yoichi Nishimura

Other Decks in Technology

Transcript

  1. NotificationCompat.BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle() .bigPicture(backgroundImage) .setBigContentTitle("iQON͔Βͷ͓஌Βͤ") .setSummaryText(message); ! NotificationManagerCompat

    notificationManager = NotificationManagerCompat.from(getApplicationContext()); Notification notification = new NotificationCompat.Builder(getApplicationContext()) .setSmallIcon(R.drawable.icon) .setDefaults(Notification.DEFAULT_SOUND) .setContentTitle("iQON͔Βͷ͓஌Βͤ") .setContentText(message) .setContentIntent(contentIntent) .setStyle(bigPictureStyle) .setAutoCancel(true) .build(); notificationManager.notify(1, notification); എܠͷ࠷దԽͦͷ w #JH1JDUVSF4UZMFΛઃఆ͢Δ
  2. എܠͷ࠷దԽͦͷ w 8FBS͚ͩʹӨڹΛग़͍ͨ͠৔߹͸
 8FBSBCMF&YUFOEFSΛ࢖ͬͯഎܠΛઃఆ NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(); if

    (backgroundImage != null) { wearableExtender.setBackground(backgroundImage); } ! Notification notification = new NotificationCompat.Builder(getApplicationContext()) .setSmallIcon(R.drawable.icon) .setDefaults(Notification.DEFAULT_SOUND) .setContentTitle(“iQON͔Βͷ͓஌Βͤ“) .setContentText(message) .setContentIntent(contentIntent) .setAutoCancel(true) .extend(wearableExtender) .build();
  3. RemoteInput remoteInput = new RemoteInput.Builder("VOICE_SEARCH_DISCOUNT_ITEM") .setLabel("ηʔϧΞΠςϜΛݕࡧ") .build(); ! NotificationCompat.Action action

    = new NotificationCompat.Action.Builder( R.drawable.ic_big_search, “ηʔϧΞΠςϜΛݕࡧ”, contentIntent) .addRemoteInput(remoteInput) .build(); ! wearableExtender.addAction(action); Χʔυͷ௥ՃͱԻ੠ೖྗ w 3FNPUF*OQVUͰԻ੠ೖྗΛѻ͏͜ͱ͕Ͱ͖ͯɺ
 BEE"DUJPOͰΧʔυͷ௥ՃΛߦ͏͜ͱ͕Ͱ͖Δ