Locked accelerometer

Is it possible to track the value of the accelerometer during blocking?

I was able to write a simple application that calculates from 1 to 100 using a timer that fires an event on which I increment the counter.

But when I use the register handler for the ReadingChanged event of the accelerometer, it will no longer be triggered after the screen is locked. Even if I open the screen again, I will have to read the handler.

+4
source share
3 answers

The msdn documentation is on one page: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff941090(v=vs.105).aspx "Valid reasons for disabling uninstallation in Windows Phone OS 7.1 applications include those , where the main functions continue when the phone is locked (for example, an exercise tracking application) "

but the api sensor also reports: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202968(v=vs.105).aspx

"Sensor APIs cannot be used while the application is running under the lock screen. For more information, see" Downtime Detection for Windows Phone. "Sensor APIs cannot be used in background agents either. For more information, see Help Agents Overview for Windows Phone "

I hope that they will change the api soon, because of which it is impossible to write good applications for tracking sleep and sports ... :(

+3
source

I helped a guy with this a couple of days ago. He had an application that tracks GPS and accelerometer data under a lock screen.

It turned out that the application’s accelerometer data was no longer being tracked when manually or automatically locking the screen.

This may cause a problem.

In screen lock mode, it is recommended to minimize energy use ... turn off all unprocessed codes, such as ui updates. My understanding that the motives for identifying inactivity and working under a locked screen open during CTP was a response to a large number of reviews from map / tracking application developers who mostly need this for their application to use it.

+1
source

I am not sure about the use case where you want to use the accelerometer under the lock screen.

Applications usually run under the lock screen when you need to do something when you are not interacting with the device. like playing music or downloading a large file.

If you need accelerometer data, I would suggest that the device is held and, therefore, supposedly looked. Given this, why do you want to run under the lock screen?

If you have good reason for this, you should still know that:

when your application runs under a locked screen, it ... should minimize energy use

(from Marketplace Certification Requirement .)

In my understanding, reading values ​​from sensors does not minimize energy consumption.

-3
source

All Articles