【问题标题】:What are the limits placed on location gathering for apps running in the background on Android O devices?在 Android O 设备上后台运行的应用程序的位置收集有哪些限制?
【发布时间】:2017-10-03 03:22:51
【问题描述】:

我意识到 O 目前处于开发者预览版中,但后台位置收集发生了重大变化。它们是什么?

【问题讨论】:

    标签: android android-location fusedlocationproviderapi


    【解决方案1】:

    以下几点总结了在 O 设备上运行的应用对位置收集的限制:

    • 作为起点,后台应用每小时只会接收几次位置更新(位置更新间隔未来可能会根据系统影响和开发者的反馈进行调整)。

    • 前台应用不受这些限制的影响。

    • 这些后台限制适用于在 O 设备上运行的所有应用,无论目标 SDK 是什么

    • 以 O 为目标的应用程序进一步受到 limits on services started in the background 的约束。因此,针对 O 的应用在请求位置更新时不应使用PendingIntent.getService()。相反,他们应该使用PendingIntent.getBroadcast() 并在清单中注册BroadcastReceiver(针对N 或更低的应用程序可以使用PendingIntent.getService()PendingIntent.getBroadcast())。

    【讨论】:

    • 有人知道few times 每小时的价值吗?这是多少?
    猜你喜欢
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    • 2019-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-10
    • 2012-10-05
    相关资源
    最近更新 更多