# How to use the Windows Phone SDK Namespaces in my Unity project?

I'm developing a game with Unity and using C# as the language for the scripts. I want to use the Device Vibration in my Microsoft Phone which is easily available for Windows Phone Development in Visual Studio using the following:

using Windows.Phone.Devices.Notification;


And then calling the following method:

VibrationDevice testVibrationDevice = VibrationDevice.GetDefault();
testVibrationDevice.Vibrate(TimeSpan.FromSeconds(3));


The above works perfectly when I'm building a Windows Phone App from visual Studio. However i totally need to integrate the above functionality in my Unity game.

Any suggestions, workarounds, tips or even hacks would be really helpful. Thanks in advance.

You can write it in both C++ or C#. You will be writing a Windows Phone Class Library that will contain your native methods in it. Then you build some .dllfiles and bring those to Unity an put them in Asset>Plugins>WP directory. Then you can access those methods using namespace.
Be careful when selecting .NET version for RealDLL and FakeDLL.