Reputation: 501
I am developing an android application where I need to share location in real time. I have MySql as a server to store user location. I need to fetch location from server and update on google map. I can do this by simply calling web services to store and retrieve location by timer task. But this cause rapid battery drain , and also this not happens in real time. I want to do all this in real time, I want to move marker on the map if the user is moving. Please help me I'll be very thankful.
Upvotes: 2
Views: 1620
Reputation: 7741
If you want to get more accurate location data without the need to use a GPS. Instead, the service tries to triangulate your location by looking at the cell towers and WiFi access points around you. Then use Google Maps Geolocation API. This service is meant to save battery life and allow for better indoor location where GPS can't work.
You can also check this SO question for another solution.
Upvotes: 2
Reputation: 981
Both websockets and GCM may not work. Whenever you need a real time streaming update to be pushed from the server you need to have a TCP channel connection with your server, and that's how the travel services uber or ola works.
Check how to setup a TCP server socket
Upvotes: 2
Reputation: 370
I think you need to use websockets. You can also use GCM to push the location to the application. If you tell more about what technology you're using in the server side, we'll be able to tell more. Hope this helps.
Upvotes: 1