summaryrefslogtreecommitdiff
path: root/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b
diff options
context:
space:
mode:
authorgoblin911 <goblinliu@gmail.com>2013-08-25 21:18:19 +0800
committergoblin911 <goblinliu@gmail.com>2013-08-25 21:18:19 +0800
commit0e687f12bd2653adb55ea002b39292678366c525 (patch)
tree0ad073ec8ff2ed2716adf23a679184c38df582a1 /client/.metadata/.plugins/org.eclipse.core.resources/.history/5b
parent2efdc2f20f0306791ced5ec78a1acddfaf086f42 (diff)
...
Diffstat (limited to 'client/.metadata/.plugins/org.eclipse.core.resources/.history/5b')
-rw-r--r--client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a01d01234f0d00131719b896d543f08c42
-rw-r--r--client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b09b88be520d00131719b896d543f08c62
2 files changed, 104 insertions, 0 deletions
diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a01d01234f0d00131719b896d543f08c b/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a01d01234f0d00131719b896d543f08c
new file mode 100644
index 0000000..5ef6d3d
--- /dev/null
+++ b/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a01d01234f0d00131719b896d543f08c
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.macaroon.piztor"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="17" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar" >
+ <activity
+ android:name="com.macaroon.piztor.InitAct"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name="com.macaroon.piztor.Login"
+ android:label="@string/activity_login" >
+ </activity>
+ <activity
+ android:name="com.macaroon.piztor.Main"
+ android:label="@string/title_activity_main" >
+ </activity>
+ <activity
+ android:name="com.macaroon.piztor.Setting"
+ android:label="@string/title_activity_setting" >
+ </activity>
+ </application>
+
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+
+</manifest>
diff --git a/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b09b88be520d00131719b896d543f08c b/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b09b88be520d00131719b896d543f08c
new file mode 100644
index 0000000..5c0e0de
--- /dev/null
+++ b/client/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b09b88be520d00131719b896d543f08c
@@ -0,0 +1,62 @@
+package com.macaroon.piztor;
+
+import android.content.Context;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.os.SystemClock;
+
+
+public class Tracker implements Runnable {
+
+ private static final long TIME_DELTA = 1000 * 1; // 1 second
+ public Timer timer;
+ private final Context mContext;
+ GPSTracker myTracker;
+ Handler mHandler;
+ Message message;
+
+ public Tracker(Context context, Handler yHandler) {
+ timer = new Timer();
+ mContext = context;
+ myTracker = new GPSTracker(mContext);
+ mHandler = yHandler;
+ }
+
+ public void run() {
+ GPSTask myTask = new GPSTask();
+ timer.schedule(myTask, 0, TIME_DELTA);
+ }
+
+ class GPSTask extends TimerTask {
+ @Override
+ public void run() {
+ message = new Message();
+ message.what = 0;
+ myTracker.getLocation();
+ Log.d("Location", "Fetching location.....");
+ if (myTracker.canGetLocation()) {
+ double latitude = myTracker.getLatitude();
+ double longitude = myTracker.getLongitude();
+
+ Log.d("TTTTTTTTTTTTTTTTTTTTTTTime","TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTime");
+ System.out.println("GPSTIME" + myTracker.location.getTime());
+ System.out.println("SYSTIME" + SystemClock.elapsedRealtime());
+
+ if(myTracker.isGPSFix()) {
+ message.what = 1;
+ } else {
+ message.what = 2;
+ }
+ mHandler.sendMessage(message);
+ } else {
+ message.what = 0;
+ mHandler.sendMessage(message);
+ }
+ }
+ }
+}