简体   繁体   中英

Proximity Alert

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM