Search code examples
androidgeolocationandroid-geofence

How to know when 2 persons cross in the street ? (Geofences...)


I want to create an Android app with a simple concept : if 2 persons who have downloaded my app are crossing in the street, I want to send them a notification (immediately).

I started to use the geofences concept, but I don't know if it is the most appropriate. So my questions are the following :

  • Using the geofences (every user have his own geofence, so you are notified when entering an other user geofence), how can I make the geofence following the user when he is moving ? (with enough precision but without too much power consumption)

  • Is there another concept that is more appropriate to my problem than the geofences ?

Thank you :)


Solution

  • Since both persons are in movement, I think you need to call the position frequently and therefore it doesn't make sense anymore to use Geofences. Instead you would calculate the difference between them and push a notification from server when a certain threshold is reached.