Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Make Your Windows Phone Vibrate with PhoneGap

DZone's Guide to

Make Your Windows Phone Vibrate with PhoneGap

· Mobile Zone
Free Resource

Get gorgeous, multi-touch charts for your iOS application with just a few lines of code.

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

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.

navigator.notification.vibrate(milliseconds)

<script type="text/javascript">

function Button1_onclick()

{ navigator.notification.vibrate(20000) }

</script>

 

.Net developers: use Highcards, the industry's leading interactive charting library, without writing a single line of JavaScript.

Topics:

Published at DZone with permission of Senthil Kumar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}