How to Make the Phone Vibrate

There may be a case where you want your application to cause the phone to vibrate. For example, if while playing a game you do an invalid action. Vibrating the phone will be a certain way to get their attention. I wouldn’t over use it and I recommend you give the users the option to disable it in your settings.

 

Doing so is very easy:
 

using Microsoft.Devices;

VibrateController vibrate = VibrateController.Default;
vibrate.Start(TimeSpan.FromMilliseconds(200));

That’s it! You can mess with the timespan but 200 MS seems adequete.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>