Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking more than 100 simultaneous geofences with the new Android API

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.

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).

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

like image 688
aadnk Avatar asked Dec 04 '22 10:12

aadnk


2 Answers

I'd recommend downloading all points to a sqlite db on the device. Then find the closest 99 points with something like this: 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.

like image 90
b-ryce Avatar answered Dec 07 '22 00:12

b-ryce


I think there is a limit of 100 geofences. I am not sure if this is per application or per application per user. I have not test this idea, but can you register the first 100 locations closest to your location?

like image 40
ogramus Avatar answered Dec 06 '22 23:12

ogramus