2

I want to make a android app using google maps.In this app I want to share my location to my friend like a request, Once he accepted my request he will get the route map to my location (previously I shared) and also I want to see his moving path towards my location. Can any one please suggest me how is possible to sharing locations.

Umashankar B
  • 415
  • 8
  • 21

3 Answers3

0

I think the best way to control that sharing is using socket.IO

on the device you catch your position then emit your position to the server and on the server side you emit to other devices.

Hope helped you

Community
  • 1
  • 1
Francisco Castro
  • 435
  • 10
  • 20
0

For sharing locations and showing it on map, you need to do it in following steps

  1. Read your location using android APIs.
  2. Once he accepts your request, read his location and share it to your profile through some API to server & keep on updating location on every changed distance delta or at some time interval and share that too.
  3. Now you have co ordinates of both locations. Use them to fill data to Google Maps API and load map in one of your activity. Whenever you will receive updated location of your friend from your server, update the map and draw path between them using google maps api.
  4. For showing map to your location @ your friends side, same thing needs to be done. If your location will also change then you will have to provide your updated location to server timely as mentioned in step 2
Community
  • 1
  • 1
Neji
  • 6,591
  • 5
  • 43
  • 66
0

What if you send a geo: link to your friend? Like geo:62.0,-7.0 ? That should give the receiver a choice between all his geo-capable apps. Google Maps, OsmAnd, maybe some weather service...