I am trying to create a mobile app where when open on a mobile device will make the wearable vibrate with a certain pattern. I have seen examples such as the one in the link below: http://programmerguru.com/android-tutorial/android-vibrate-example/ But this is to make the mobile device vibrate while I want to make the wearable vibrate. Right now I have a main activity in my Android Studio for Mobile and Wearable. Any help on how to set this app up will be appreciated. Other post on stackoverflow do not answer my question as they make the device directly vibrate while i want to create an app that signals my wearable to vibrate.
Asked
Active
Viewed 773 times
1
-
Possible duplicate of [Make the wearable vibrate from within an android wear app](http://stackoverflow.com/questions/26192475/make-the-wearable-vibrate-from-within-an-android-wear-app) – Da-Jin Feb 21 '16 at 02:27
-
This is not a duplication as I have seen that Stack post and the answer did not create a app which will make an app which will make the wearable vibrate. The solution given makes the mobile or wearable device directly vibrate. Not a mobile app making the wearable viberate – Nightlife Feb 21 '16 at 04:56
1 Answers
0
Based on the assumption that you have already known how to make an android wear device vibrate. What you need to do is:
Look at the MessageApi for android wear. At the phone side, you need to send a message to notify the wearables.
At the wearable side, you need to let your activity implements a
MessageApi.MessageListener
or just create a service extending theWearableListenerService
. Once the wearable app receives the message inonMessageReceived
method with a specific path you have declared, you just vibrate the device.
Hope it can help you.

Syi
- 108
- 1
- 6