繁体   English   中英

在用户位于Android中我的位置时通知

[英]Notify when user is in my location in Android

如果要通知我,我正在寻找一种简单的方法来检查用户是否在我的位置(50m)半径内。

现在,我每两分钟运行一次服务,获取每个用户的位置进行比较,然后通知用户是否在同一位置。

可以使用promixityalert: http : //goo.gl/9I857T吗?

谢谢!

取而代之的是ProximityAlert,我将使用地理围栏。

http://developer.android.com/training/location/geofencing.html

较新并且可以更有效地使用电池

在您的情况下,您可以使用一项服务,该服务每隔X分钟将当前位置发送到另一台设备,从而可以更新Geofence。 我看到的问题是,将会有大量的通话,电量消耗和数据计划。

一个好的方法是使用Location Services API,您可以检测用户是站立还是移动。

http://developer.android.com/training/location/activity-recognition.html

仅在用户移动时使用此功能并发送新位置,您将能够减少通话量。

解析是@thepace提及的另一种选择。 它很容易使用,也很容易实现您想做的事情,但是它不是免费的:(

希望能帮助到你。

Issue: Check if any user (multiple and variable location) is within specific radius of my current location(variable).

Solution: 
1. Parse.com
a) Ensure every user has their location updated in Parse DB including yours.
   https://parse.com/tutorials/anywall-android
b) Use push notificaitons: https://parse.com/docs/push_guide#setup/Android 
   1> Create a channel wherein only you are subscribed.
   2> Create your installation query and send notification to it to the channel subscribed.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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