O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Launching vibrations

Vibrating a smartphone is one of the possible approaches to inform a user about important events. In this recipe, you will learn how to programmatically start vibrations.

As an example, you will prepare a simple page with the Start vibrations button. After clicking on it, the vibrations should be started only for 1 second.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To prepare an example that launches vibrations, perform the following steps:

  1. Add a reference to Windows Mobile Extensions for the UWP. To do so, choose Add | Reference... from the context menu of the project node in the Solution Explorer window, click on Universal Windows | Extensions in the Reference ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required