[英]Proximity Alert
I want to make an application for Android 2.2+, utilizing the GPS. 我想利用GPS为Android 2.2+开发应用程序。 Basically I want to be able to set a specific zone in the app, using google maps.
基本上,我希望能够使用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. 示例:我正走到商店时,只要我离家x(可变)米远,我就希望手机响起警报声。
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. 我在Google上搜索后发现,当您靠近朋友之家或类似的地方时,可以使用邻近警报来接收通知。 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. 我认为您需要在Google地图中用一些公式自己绘制线。
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 http://developer.android.com/reference/android/location/LocationManager.html#KEY_PROXIMITY_ENTERING
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.