1

I am very new to android, i know how to get the location using GPS, but my doubt is,

Can I track each and every move of user in particular time?

Take an example : I have moved 20 km by car.How can I know the latitude and longitude of all the areas I have crossed ? Please suggest a related post or give me an idea to do.

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
Madhu
  • 1,780
  • 23
  • 47
  • possible duplicate of [Create an Android GPS tracking application](http://stackoverflow.com/questions/5096192/create-an-android-gps-tracking-application) – ohlmar Feb 21 '14 at 07:43
  • Am i need to run the gps in background to track the location? – Madhu Feb 21 '14 at 07:46
  • Android [LocationManager](http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates%28long,%20float,%20android.location.Criteria,%20android.app.PendingIntent%29) Simply gice you a method to request a location update at every specified distance. So just part your GPS request in distance and track location simple. – user370305 Feb 21 '14 at 07:46

2 Answers2

2

The source code for the Android mobile application open-gpstracker is available at:

https://code.google.com/p/open-gpstracker/source/checkout

You can checkout the code using SVN client application or via Git:

svn checkout

http://open-gpstracker.googlecode.com/svn/trunk/ open-gpstracker-read-only

git clone https://code.google.com/p/open-gpstracker/

Debugging the source code will surely help you.

Source: Create an Android GPS tracking application

Community
  • 1
  • 1
Hassaan Rabbani
  • 2,469
  • 5
  • 30
  • 55
2

check this link & check answer of @CapDroid ,try the Code you can use TIMER for what you want

Timer t = new Timer(); t.scheduleAtFixedRate(task, when, period);

OR

try This Code For Location Update @ certain Time Specified.

LocationManager mLocationManager =(LocationManager).getSystemService(mActivity.LOCATION_SERVICE);
mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 0, new   GeoUpdateHandler());

Look at LocationManager.requestLocationUpdates, just pass your time interval in parameter.. Hope this helps You.

Community
  • 1
  • 1
i.n.e.f
  • 1,773
  • 13
  • 22