Search code examples
c#windows-phoneaccelerometerwindows-phone-8.1uiaccelerometer

Windows phone 8.1 Accelerometer and updating UI


I having problems finding documentation or examples regarding the proper way to use the Accelerometer as well as updating a textbox using Dispatcher. Seems like it should be easy, but all the examples are 8.0 which apparently used using Microsoft.Devices.Sensors;

Apparently you are supposed to use using Windows.Devices.Sensors; which you would think are the same, but things like Start() and Stop methods no longer exist. I was trying to use a Microsoft AccelerometerHelper class from Microsoft here

Also the older Dispatcher is now CoreDispatcher based on this?

Also was trying to use this library, but it also uses the old namespace: http://code.msdn.microsoft.com/wpapps/Shake-Gesture-Library-04c82d5f

Can anyone either provide an example or direct me to some information on how in 8.1, you would register the Accelerometer events and update the UI textbox with something like the x-axis?

Thank you very much!


Solution

  • I ended up using Silverlight 8.1 for this particular app per Microsoft. They are "looking" into why the phone API is the only one without a shake event.