Vibration on Xamarin Android

Markus Olsson picture Markus Olsson · Aug 6, 2014 · Viewed 8.4k times · Source

Im currently working on an application using Xamarin android. I cannot get the device to vibrate though.

Vibrator vibrator = (Vibrator)Activity.GetSystemService(Context.VibratorService);
vibrator.Vibrate(100);

It builds but crashes when I press the button that is linked to the code.

Answer

Dima picture Dima · Feb 14, 2015

This solves the problem AndroidManifest.xml

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