[英]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.