Make wear vibrating from inside the aortic app

I am writing a simple nasal app for my LG watch that sends vibrations to the watch at regular intervals and show some data.

Although I was looking for an answer, I could not find a way to make the clock vibrate. Any help would be assigned.

+7
android wear vibration
source share
1 answer

@ Drew, thanks!

If anyone else is interested, here is a code snippet demonstrating vibration on your watch:

  • Add the following line to your AndroidManifest.xml:

    <uses-permission android:name="android.permission.VIBRATE"/> 
  • In your code:

      Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); long[] vibrationPattern = {0, 500, 50, 300}; //-1 - don't repeat final int indexInPatternToRepeat = -1; vibrator.vibrate(vibrationPattern, indexInPatternToRepeat); 
+33
source share

All Articles