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

The VibrateController Class for Windows Phone

DZone's Guide to

The VibrateController Class for Windows Phone

· Mobile Zone
Free Resource

Launching an app doesn’t need to be daunting. Whether you’re just getting started or need a refresher on mobile app testing best practices, this guide is your resource! Brought to you in partnership with Perfecto

I am currently working on another Windows Phone Application, where I needed a way to show the user that they had successfully performed a task and therefore unlocked another feature inside the application.

First idea was adding some sound, but somehow I was not happy with that. So I thought, why not let the phone vibrate?

It’s actually not that hard. The Windows Phone 7 SDK allows me to control the vibrate function easily.

In the namespace Microsoft.Devices there is a class defined with the name ‘VibrateController’.

The only code I need for that function is:

When the user clicks the particular button, the phone vibrates.

A few thoughts to keep in mind:

1. the shortest vibration / pause is 0.1 seconds.

2. the longest is 5 seconds, but that is not recommended.

3. 3 vibrations in one sequence are enough.

4. 0.2 / 0.3 are good choices for an alert.

 

Here you can find more information about the VibrateController Class.

 

To be continued…

Keep up with the latest DevTest Jargon with the latest Mobile DevTest Dictionary. Brought to you in partnership with Perfecto.

Topics:

Published at DZone with permission of Andrea Haubner, 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 }}