I am making a real-time location tracker android app. Yes there are lot of duplicate questions but here is my scenario. Device's latitudes and longitude are changing continuously, So I have to send the data to at server almost every 2 seconds.
http://myserver.com/tracker.php?lat=10&long=5&guid=123456
On the other side another device will be fetching the location continuously every 2 second
http://myserver.com/getlocation.php?guid=123456
I am new in android development but googled about GCM, Bacground services and asyncTask. Battery drain is not a issue for now. and I concerned about background services too. What will be the best approach to send and fetch the data every 2 seconds ? using AsyncTask or something else ?