Windows Phone and PhoneGap – Article #6 – Make your WP7 Vibrate

The Windows Phone SDK in Silverlight provides the class VibrateController which the developer can make use of it to vibrate the phone .

All that the developer has to do is create an instance of the VibrateController and call the start method with the timespan .

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

Check How to make a Windows Phone 7 Vibrate using C# ? to learn more

Similarly , PhoneGap provides the notification.vibrate method to make your Windows Phone vibrate .

The navigator.notification.vibrate takes one argument i.e the milliseconds to vibrate your Windows Phone .

Windows Phone and PhoneGap - Article #6 - Make your WP7 Vibrate

Windows Phone and PhoneGap - Article #6 - Make your WP7 Vibrate

navigator.notification.vibrate(milliseconds)

<script type="text/javascript">

function Button1_onclick()

{ navigator.notification.vibrate(20000) }

</script>
Share