Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run accelerometer of iPhone in background?

I want to use accelerometer of iPhone to get the log file of accelerometer value (maybe for 24 hours). Is it possible to let accelerometer runs in background while other applications are running?

like image 759
newbie Avatar asked Feb 19 '10 08:02

newbie


2 Answers

You can do it now, if your app is allowed to run in the background for other reasons. See the Core Motion API's startAccelerometerUpdatesToQueue:withHandler: method here.

like image 70
sounder_michael Avatar answered Oct 26 '22 16:10

sounder_michael


Nope, it is not. You basically can't run anything but a music app in the background.

You can run the accelerometer while the phone is suspended though.

See this blog for how to do it: http://marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/

I use this technique in my GPS recording app.

like image 32
Andrew Johnson Avatar answered Oct 26 '22 16:10

Andrew Johnson