Add Wear Notifications to Android App
1 min read

Add Wear Notifications to Android App

Add Wear Notifications to Android App

TL;DR: Use notification mechanism. Steps are:

  • Create a WearableExtender:

    NotificationCompat.WearableExtender wearableExtender =
    new NotificationCompat.WearableExtender()
  • Extend the notification mechanism:

    NotificationCompat.Builder mBuilder =
    new NotificationCompat.Builder(this)
    .setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
    .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
  • Trigger the notification:

    NotificationManagerCompat.from(this).notify(NOTIFICATION_ID, notification);

After reading various sources, I got my application to send notification to my watch using the code above. At the beginning, I thought the notifications weren't sent. I thought I needed to enable wear in the manifest (which I did), but... notifications were sent, just the watch was on charging dock and was't doing anything :(.

To make sure things were OK, I've enabled vibration:

Notification notification =;
notification.defaults |= Notification.DEFAULT_VIBRATE;

NotificationManagerCompat.from(this).notify(NOTIFICATION_ID, notification);

Note: You need <uses-permission android:name="android.permission.VIBRATE"/> in your Manifest.xml file. References are here, here and, if you dig enough, on GitHub.

Now the watch (and the phone) vibrate when the notification is triggered! Cool!

screen - wearable

PS: Never mind the amazon underground swatch :)