diff options
Diffstat (limited to 'client/activity-demo/Piztor/src/com/example/piztor/Tracker.java')
-rw-r--r-- | client/activity-demo/Piztor/src/com/example/piztor/Tracker.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/client/activity-demo/Piztor/src/com/example/piztor/Tracker.java b/client/activity-demo/Piztor/src/com/example/piztor/Tracker.java new file mode 100644 index 0000000..ceda506 --- /dev/null +++ b/client/activity-demo/Piztor/src/com/example/piztor/Tracker.java @@ -0,0 +1,34 @@ +package com.example.piztor; + +import java.util.Timer; +import java.util.TimerTask; + +public class Tracker implements Runnable { + + private static final long TIME_DELTA = 1000 * 60 * 5; + public final Context mContext; + + Controller controller; + + public Tracker(Controller newController) { + controller = newController; + } + + public Timer timer; + public void run() { + 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); + } + } +} |