djcouchycouch
djcouchycouch

Reputation: 12832

Accessing the vibration function in Windows 8 WinRT?

Is there an WinRT API in Windows 8 or Windows Phone 8 to use the vibration function?

Upvotes: 6

Views: 2563

Answers (4)

Galinho
Galinho

Reputation: 41

Try this: (Only works on Windows Phone!)

var vibrationTime = TimeSpan.FromMilliseconds(100);
Windows.Phone.Devices.Notification.VibrationDevice.GetDefault().Vibrate(vibrationTime);

Upvotes: 4

Paras Wadehra
Paras Wadehra

Reputation: 478

You can use the VibrateController or VibrationDevice class to achieve vibration effect in your Windows Phone apps.

Refer http://blogs.msdn.com/b/paraswadehra/archive/2014/06/25/how-to-make-your-windows-phone-app-vibrate.aspx for details.

Upvotes: 0

Apoorv Kumar Upadhyay
Apoorv Kumar Upadhyay

Reputation: 125

We do have one for Windows Phone 8 and 7 , but we don't have for WinRT tablets

Upvotes: 0

Filip Skakun
Filip Skakun

Reputation: 31724

The leaked docs seem to mention the Microsoft.Devices.VibrateController class being available both in WP7 and WP8. I don't think there is something like that in WinRT though. I think tablets usually don't have a vibrator? Seems to be more like a feature of a phone that you might keep silenced in your pocket.

Some articles on vibrations

Upvotes: 2

Related Questions