Namespaces
Variants
Actions
Revision as of 08:35, 30 November 2012 by hamishwillee (Talk | contribs)

How to turn on vibration on Windows Phone

Jump to: navigation, search

This tip shows how to vibrate the device for a specified period using the VibrateController class.

WP Metro Icon UI.png
Article Metadata

Tested with
Devices(s): Nokia Lumia 800, Samsung Focus Flash

Compatibility
Platform(s): Windows Phone 7.5

Article
Created: influencer (12 Sep 2012)
Last edited: hamishwillee (30 Nov 2012)

Overview

The VibrateController class can be used to vibrate the device for a specific period. This can be useful for acknowledging a button press if visual cues alone are not enough (for example one of my apps that has a 'copy clipboard' button did not have a visible reaction so I added a short vibration to notice the user that the tap was successful).

This code snippet is all that is required to vibrate the phone for 100ms:

using Microsoft.Devices;
//...
VibrateController.Default.Start(TimeSpan.FromMilliseconds(100));
180 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved