跟踪超过100个并发geofences新的Andr​​oid API [英] Tracking more than 100 simultaneous geofences with the new Android API

查看:181
本文介绍了跟踪超过100个并发geofences新的Andr​​oid API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在9000平方公里的区域利益3500左右的地理点,我想我的应用程序在后台运行,并通知用户,只要他或她是在接近上述任何点。

I have around 3500 geographical points of interest in an area of 9000 km^2, and I want my app to run in the background and notify the user whenever he or she is in proximity to any of the aforementioned points.

地理栅栏API 在谷歌我介绍/ O 2013似乎是完美的这项工作,特别是它的电池寿命优化,但我似乎无法注册超过100 geofences之前,我的状态code <一个href="https://developer.android.com/reference/com/google/android/gms/location/LocationStatus$c$cs.html#GEOFENCE_TOO_MANY_GEOFENCES"相对=nofollow> GEOFENCE_TOO_MANY_GEOFENCES (使用演示应用程序的修改版本)。

The new Geofence API introduced during Google I/O 2013 seemed perfect for the job, especially as its optimized for battery life, but I can't seem to register more than 100 geofences before I get the status code GEOFENCE_TOO_MANY_GEOFENCES (using a modified version of the demo app).

是否有可能增加此限制?也许通过一些设置或API?

Is it possible to increase this limit? Perhaps through some setting or API?

推荐答案

我建议你下载所有指向设备上的sqlite的分贝。然后找到最接近99点是这样的:<一href="http://stackoverflow.com/questions/3695224/android-sqlite-getting-nearest-locations-with-latitude-and-longitude">Android - SQLite的获取最近的位置(经纬度)并注册那些点与Android监控

I'd recommend downloading all points to a sqlite db on the device. Then find the closest 99 points with something like this: Android - SQlite Getting nearest locations (with latitude and longitude) and register those points with Android to monitor.

然后设置一个显著改变地理围栏,你可以用它来监控,如果用户的位置发生了变化,以至于当他们退出地理围栏,你应该重新加载感兴趣的最近点。

Then set a "significant change" geofence that you can use to monitor if the user's location has changed enough that when they exit this geofence, you should reload the closest points of interest.

这篇关于跟踪超过100个并发geofences新的Andr​​oid API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆