I’m making an app that uses the GoogleMap, v2. And the user should be able to select a point, and then radius. So the radius will go e.g 10 meters around the selected point, and somehow save it and when the user moves, the device should check like; “Hm… Is he in the selected area or not?”, bad explanation I know but you get the point. So I thought a lot how I should do this, but haven’t really found any good solution. Thought about maybe save e.g 100 coordinates in a Array, and then the device should check if your current location matches any of the coordinates in the Array. But I don’t really know if that’s to heavy for the device, you know like it would make the device way too laggy or something like that… Or am I just totally wrong? Or is there such a method build in in the Maps API already?
I hope at least someone get what I mean and want to help me! Thanks in advance.
Ps. Sorry for bad english!
What you are probably looking for is proximity alerts. Check out this tutorial and, of course, the documentation.
From my expirience, standard implementation is far from perfect (there is an infamous bug with
KEY_PROXIMITY_ENTERING, and excessive battery drain when proximity alerts are set), so you might want to think twice if you want to use it. If you decide it’s not worth it, and if you want to implement something similar yourself, here’s the library to start with.