summaryrefslogtreecommitdiff
path: root/client/gps-demo/AndroidGPSTracking
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-08-23 14:20:44 +0800
committerTeddy <[email protected]>2013-08-23 14:20:44 +0800
commit34692fa869ae60e7c35e196542941df845e1fee7 (patch)
tree219e3032dcbdc635f2e732b25edf81c589066a41 /client/gps-demo/AndroidGPSTracking
parentdc4111896079c991548c53724f6f42c3147dd738 (diff)
parent4e845dd78e4a3a1d24d5edafbdd51ede18e4a358 (diff)
Merge branch 'master' of github.com:Determinant/piztor
Diffstat (limited to 'client/gps-demo/AndroidGPSTracking')
-rw-r--r--client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java b/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java
new file mode 100644
index 0000000..2e08a91
--- /dev/null
+++ b/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);
+ }
+ }
+}