Reputation: 12832
Is there an WinRT API in Windows 8 or Windows Phone 8 to use the vibration function?
Upvotes: 6
Views: 2563
Reputation: 41
Try this: (Only works on Windows Phone!)
var vibrationTime = TimeSpan.FromMilliseconds(100);
Windows.Phone.Devices.Notification.VibrationDevice.GetDefault().Vibrate(vibrationTime);
Upvotes: 4
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
Reputation: 125
We do have one for Windows Phone 8 and 7 , but we don't have for WinRT tablets
Upvotes: 0
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