diff options
author | Teddy <[email protected]> | 2013-08-25 17:55:34 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-25 17:55:34 +0800 |
commit | f4d0989ae888bc2f83f0bc09cc826f7c79b1b6b5 (patch) | |
tree | 79c9fbb49a5a857c56843cef01b032e3430aa085 /misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java | |
parent | f74999631c4f83a0c8532d6b7adb348dcd5d5205 (diff) | |
parent | 0a76dad753ed88a7575c2aafdd068ef6caa7247f (diff) |
Merge branch 'master' of github.com:Determinant/piztor
Diffstat (limited to 'misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java')
-rw-r--r-- | misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java b/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java new file mode 100644 index 0000000..2e08a91 --- /dev/null +++ b/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java @@ -0,0 +1,33 @@ +package com.example.gpstracking; + +import java.util.Timer; +import java.util.TimerTask; + +public class Tracker implements Runnable { + + private static final long TIME_DELTA = 1000 * 60 * 5; + + Controller controller; + + public Tracker(Controller newController) { + controller = newController; + } + + public void run() { + public Timer timer; + TimerTask task = new GPSTask(); + timer.schedule(new GPSTask(), 0, TIME_DELTA); + } + + class GPSTask extends TimerTask { + public void run() { + GPSTracker tracker; + tracker = new GPSTracker(Tracker.this); + + double latitude = tracker.getLatitude(); + double longitude = tracker.getLongitude(); + + controller.recieveLocation(latitude, longitude); + } + } +} |