iPhone的加速度计可以在后台运行吗?

发布于 2024-08-21 18:32:33 字数 71 浏览 3 评论 0原文

我想使用iPhone的加速度计来获取加速度计值的日志文件(可能是24小时)。当其他应用程序运行时,是否可以让加速度计在后台运行?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

廻憶裏菂餘溫 2024-08-28 18:32:33

如果您的应用程序因其他原因被允许在后台运行,您现在就可以执行此操作。请参阅 Core Motion API 的 startAccelerometerUpdatesToQueue:withHandler: 方法 此处

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.

九命猫 2024-08-28 18:32:33

不,事实并非如此。除了在后台运行音乐应用程序外,您基本上无法运行任何其他程序。

不过,您可以在手机暂停时运行加速度计。

请参阅此博客了解如何操作: http://marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/

我在我的 GPS 记录应用程序中使用了这种技术。

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.

这样的小城市 2024-08-28 18:32:33

不,目前不可能,至少如果您想通过 App Store 分发您的应用程序。

No, it is presently not possible, at least if you want to distribute your application through the App Store.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文