0

I want to make an application for Android 2.2+, utilizing the GPS. Basically I want to be able to set a specific zone in the app, using google maps.

Example: I am walking to the store, as soon as I am x (variable) meters away from my house I want an alarm going off on my phone.

I googled and saw that you can use proximity alerts to get a notification when you are close to a friends house or something like that. They used specific coordinates for this. I want to be able to draw a line on a map or use a street name, and as soon as i cross that line i want an alarm to go off. If anyone could point me to some tutorial for that part or give some advice, that would be great.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
Druidys
  • 81
  • 3
  • 11
  • You might want to check out the haversine formula for calculating prmoximity and for drawing a line you can look at polylines under overlays in google maps javascript api – consprice Jul 13 '12 at 04:52

1 Answers1

0

I think you need to map your line in google maps yourself with some formula.

Proximity alerts work with a radius. You might need to set up multiple points with a small radius along your line.

You will get either the entering Intent or the exiting intent.

http://developer.android.com/reference/android/location/LocationManager.html#KEY_PROXIMITY_ENTERING

n3utrino
  • 2,361
  • 3
  • 22
  • 32
  • So just drawing a line on google maps to set a perimeter wouldn't work with Proximity?. Is there anything else? Or should i just use as example: 3 points with a tiny radius (how low can this go?) and spread them from left to right, so that the left points radius overlaps a little bit with the middle and the middle with the right one (which obviously wont make a real line but will come as close as possible)? Last question, instead of giving an alert when i get in radius of a point of interest. Could i get an alert when i go out of the point of radius? – Druidys Jul 13 '12 at 13:07