I'm playing with the Windows Phone 8 API, specifically with the accelerometer. I don't have a device to publish to, so I'm using the emulator to test my app.
I'd like to simulate knocking the phone, to simulate an acceleration greater than 1G.
I'm calculating the total acceleration like this:
private static double CalculateGForce(double x, double y, double z)
{
return Math.Sqrt(x*x + y*y + z*z);
}
Can I achieve this using the emulator? When I drag the red ball around, I never get G > 1.
The Windows Phone emulator comes with a single set of 'recorded data' called Shake. One idea might be to create your own set of recorded that gives the desired g-force.
For Windows Phone 7.1
C:\Program Files (x86)\Microsoft XDE\1.0\sensordata\acc
For Windows Phone 8
C:\Program Files (x86)\Microsoft XDE.0\sensordata\acc
And as the post mentions, 'offset' is the time between changes so you'll want small offsets and larger changes between sets of X,Y,Z values.
<AccData offset="1" x="-00.08400000" y="-01.02100003" z="-00.41700000" />
<AccData offset="5" x="-00.14200000" y="-00.95099998" z="-00.39700001" />