Home » Android » Vibrate an Android Wear device on notification

Vibrate an Android Wear device on notification

Posted by: admin June 15, 2020 Leave a comment


I’m trying to develop an app for android and android wear. I create a notification from the mobile to the watch.

notification = new NotificationCompat.Builder(context)
                    .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000, 1000})
                    .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), background))

In the manifest of the watch I set :

<uses-permission android:name="android.permission.VIBRATE"/>

Unfortunately, I haven’t any vibration.

How can I do ?


How to&Answers:

This line of code will make the wear wake up and vibrate.


I would like to add 1 more updated answer for SDK 26 and above. I spent many hours trying to determine why my notifications would not vibrate on the Android Wear watch.

I eventually noticed that someone had set the priority on the notification channel to IMPORTANCE_MIN.

if (Build.VERSION.SDK_INT >= 26) {
    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    NotificationChannel notificationChannel = new NotificationChannel(Config.NOTIFICATION_CHANNEL_ID, Config.NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_MIN);

To fix the issue, I did the following:

  • Uninstalled the app from the phone
  • Changed the priority to HIGH [Though I suspect NORMAL will work also]
  • Reinstalled the app

Updated Code:


Note: You also need to ensure that your defaults are correct as ‘Android enthusiast’ pointed out in his earlier answer.

I hope it saves someone from an investigation.