diff options
author | Teddy <[email protected]> | 2013-08-25 20:54:18 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-25 20:54:18 +0800 |
commit | 69a0eecd6a831127d04970c4c1b5749c641b8e5e (patch) | |
tree | 913847bb7de0ec79ced41b2bb79ed9ed1698df6b /misc/client/gps-demo | |
parent | 951907736830aadaebf8088433401b6d752e1cec (diff) |
removed obsolete dir
Diffstat (limited to 'misc/client/gps-demo')
40 files changed, 0 insertions, 490 deletions
diff --git a/misc/client/gps-demo/AndroidGPSTracking/.AndroidManifest.xml.swp b/misc/client/gps-demo/AndroidGPSTracking/.AndroidManifest.xml.swp Binary files differdeleted file mode 100644 index d03b360..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/.AndroidManifest.xml.swp +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/.classpath b/misc/client/gps-demo/AndroidGPSTracking/.classpath deleted file mode 100644 index 5176974..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="output" path="bin/classes"/> -</classpath> diff --git a/misc/client/gps-demo/AndroidGPSTracking/.project b/misc/client/gps-demo/AndroidGPSTracking/.project deleted file mode 100644 index a080853..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>AndroidGPSTracking</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/misc/client/gps-demo/AndroidGPSTracking/.settings/org.eclipse.jdt.core.prefs b/misc/client/gps-demo/AndroidGPSTracking/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2d..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/misc/client/gps-demo/AndroidGPSTracking/AndroidManifest.xml b/misc/client/gps-demo/AndroidGPSTracking/AndroidManifest.xml deleted file mode 100644 index 137894c..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.gpstracking"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk android:minSdkVersion="8" />
-
- <application
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
- <activity
- android:name=".AndroidGPSTrackingActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.INTERNET" />
-
-</manifest>
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidGPSTracking.apk b/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidGPSTracking.apk Binary files differdeleted file mode 100644 index 985304a..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidGPSTracking.apk +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidManifest.xml b/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidManifest.xml deleted file mode 100644 index 137894c..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.gpstracking"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk android:minSdkVersion="8" />
-
- <application
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
- <activity
- android:name=".AndroidGPSTrackingActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.INTERNET" />
-
-</manifest>
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes.dex b/misc/client/gps-demo/AndroidGPSTracking/bin/classes.dex Binary files differdeleted file mode 100644 index 1a8d494..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes.dex +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity$1.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity$1.class Binary files differdeleted file mode 100644 index 3367336..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity$1.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity.class Binary files differdeleted file mode 100644 index 7df00e1..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/AndroidGPSTrackingActivity.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/BuildConfig.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/BuildConfig.class Binary files differdeleted file mode 100644 index 15960aa..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/BuildConfig.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$1.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$1.class Binary files differdeleted file mode 100644 index 8e2ea2b..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$1.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$2.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$2.class Binary files differdeleted file mode 100644 index 572f305..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker$2.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker.class Binary files differdeleted file mode 100644 index 6f6bd93..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/GPSTracker.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$attr.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$attr.class Binary files differdeleted file mode 100644 index 1dbe417..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$attr.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$drawable.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$drawable.class Binary files differdeleted file mode 100644 index f46f86d..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$drawable.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$id.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$id.class Binary files differdeleted file mode 100644 index 7d48158..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$id.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$layout.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$layout.class Binary files differdeleted file mode 100644 index 08f0ade..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$layout.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$string.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$string.class Binary files differdeleted file mode 100644 index 7c72195..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R$string.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R.class b/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R.class Binary files differdeleted file mode 100644 index 7f0475e..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/classes/com/example/gpstracking/R.class +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/dexedLibs/annotations-5b022f4578500e25e3bfa446659bd7d8.jar b/misc/client/gps-demo/AndroidGPSTracking/bin/dexedLibs/annotations-5b022f4578500e25e3bfa446659bd7d8.jar Binary files differdeleted file mode 100644 index 61505d5..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/dexedLibs/annotations-5b022f4578500e25e3bfa446659bd7d8.jar +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/jarlist.cache b/misc/client/gps-demo/AndroidGPSTracking/bin/jarlist.cache deleted file mode 100644 index 0565465..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/jarlist.cache +++ /dev/null @@ -1,3 +0,0 @@ -# cache for current jar dependency. DO NOT EDIT. -# format is <lastModified> <length> <SHA-1> <path> -# Encoding is UTF-8 diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-hdpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-hdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 882eb14..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-hdpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-ldpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-ldpi/ic_launcher.png Binary files differdeleted file mode 100644 index 18689f6..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-ldpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-mdpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-mdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 02e96b9..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/res/drawable-mdpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/bin/resources.ap_ b/misc/client/gps-demo/AndroidGPSTracking/bin/resources.ap_ Binary files differdeleted file mode 100644 index 8c035b7..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/bin/resources.ap_ +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/default.properties b/misc/client/gps-demo/AndroidGPSTracking/default.properties deleted file mode 100644 index 32299c2..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/default.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Project target. -target=android-8 diff --git a/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/BuildConfig.java b/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/BuildConfig.java deleted file mode 100644 index c164cb3..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/BuildConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -/** Automatically generated file. DO NOT MODIFY */ -package com.example.gpstracking; - -public final class BuildConfig { - public final static boolean DEBUG = true; -}
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/R.java b/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/R.java deleted file mode 100644 index c747309..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/gen/com/example/gpstracking/R.java +++ /dev/null @@ -1,26 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.example.gpstracking; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int ic_launcher=0x7f020000; - } - public static final class id { - public static final int btnShowLocation=0x7f050000; - } - public static final class layout { - public static final int main=0x7f030000; - } - public static final class string { - public static final int app_name=0x7f040001; - public static final int hello=0x7f040000; - } -} diff --git a/misc/client/gps-demo/AndroidGPSTracking/proguard.cfg b/misc/client/gps-demo/AndroidGPSTracking/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native <methods>; -} - --keepclasseswithmembers class * { - public <init>(android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public <init>(android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/misc/client/gps-demo/AndroidGPSTracking/project.properties b/misc/client/gps-demo/AndroidGPSTracking/project.properties deleted file mode 100644 index ea89160..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-hdpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/res/drawable-hdpi/ic_launcher.png Binary files differdeleted file mode 100644 index efc8f0a..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-hdpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-ldpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/res/drawable-ldpi/ic_launcher.png Binary files differdeleted file mode 100644 index efc8f0a..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-ldpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-mdpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/res/drawable-mdpi/ic_launcher.png Binary files differdeleted file mode 100644 index efc8f0a..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-mdpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-xhdpi/ic_launcher.png b/misc/client/gps-demo/AndroidGPSTracking/res/drawable-xhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index efc8f0a..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/drawable-xhdpi/ic_launcher.png +++ /dev/null diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/layout/main.xml b/misc/client/gps-demo/AndroidGPSTracking/res/layout/main.xml deleted file mode 100644 index 430efa2..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/layout/main.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <Button android:id="@+id/btnShowLocation"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Show Location"
- android:layout_centerVertical="true"
- android:layout_centerHorizontal="true"/>
-
-</RelativeLayout>
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/res/values/strings.xml b/misc/client/gps-demo/AndroidGPSTracking/res/values/strings.xml deleted file mode 100644 index 6c854c3..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="hello">Hello World, AndroidGPSTrackingActivity!</string>
- <string name="app_name">AndroidGPSTracking</string>
-
-</resources>
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/AndroidGPSTrackingActivity.java b/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/AndroidGPSTrackingActivity.java deleted file mode 100644 index cdc1413..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/AndroidGPSTrackingActivity.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.example.gpstracking; - -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.Toast; - -public class AndroidGPSTrackingActivity extends Activity { - - Button btnShowLocation; - - // GPSTracker class - GPSTracker gps; - - @Override - public void onCreate(Bundle savedInstanceState) { - - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - btnShowLocation = (Button) findViewById(R.id.btnShowLocation); - - // show location button click event - btnShowLocation.setOnClickListener(new View.OnClickListener() { - - @Override - public void onClick(View arg0) { - // create class object - gps = new GPSTracker(AndroidGPSTrackingActivity.this); - - // check if GPS enabled - if(gps.canGetLocation()){ - - double latitude = gps.getLatitude(); - double longitude = gps.getLongitude(); - - Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show(); - }else{ - // can't get location - // GPS or Network is not enabled - // Ask user to enable GPS/network in settings - gps.showSettingsAlert(); - } - - } - }); - } - -}
\ No newline at end of file diff --git a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/GPSTracker.java b/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/GPSTracker.java deleted file mode 100644 index f1e77ad..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/GPSTracker.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.example.gpstracking;
-
-import android.app.AlertDialog;
-import android.app.Service;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.os.Bundle;
-import android.os.IBinder;
-import android.provider.Settings;
-import android.util.Log;
-
-public class GPSTracker extends Service implements LocationListener {
-
- private final Context mContext;
-
- // flag for GPS status
- boolean isGPSEnabled = false;
-
- // flag for network status
- boolean isNetworkEnabled = false;
-
- // flag for GPS status
- boolean canGetLocation = false;
-
- Location location; // location
- double latitude; // latitude
- double longitude; // longitude
-
- // The minimum distance to change Updates in meters
- private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
-
- // The minimum time between updates in milliseconds
- private static final long MIN_TIME_BW_UPDATES = 10 * 60 * 1; // 1 minute
-
- // Declaring a Location Manager
- protected LocationManager locationManager;
-
- public GPSTracker(Context context) {
- this.mContext = context;
- getLocation();
- }
-
- public Location getLocation() {
- try {
- locationManager = (LocationManager) mContext
- .getSystemService(LOCATION_SERVICE);
-
- // getting GPS status
- isGPSEnabled = locationManager
- .isProviderEnabled(LocationManager.GPS_PROVIDER);
-
- // getting network status
- isNetworkEnabled = locationManager
- .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
-
- if (!isGPSEnabled && !isNetworkEnabled) {
- // no network provider is enabled
- } else {
- this.canGetLocation = true;
- if (isNetworkEnabled) {
- locationManager.requestLocationUpdates(
- LocationManager.NETWORK_PROVIDER,
- MIN_TIME_BW_UPDATES,
- MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
- Log.d("Network", "Network");
- if (locationManager != null) {
- location = locationManager
- .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
- if (location != null) {
- latitude = location.getLatitude();
- longitude = location.getLongitude();
- }
- }
- }
- // if GPS Enabled get lat/long using GPS Services
- if (isGPSEnabled) {
- if (location == null) {
- locationManager.requestLocationUpdates(
- LocationManager.GPS_PROVIDER,
- MIN_TIME_BW_UPDATES,
- MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
- Log.d("GPS Enabled", "GPS Enabled");
- if (locationManager != null) {
- location = locationManager
- .getLastKnownLocation(LocationManager.GPS_PROVIDER);
- if (location != null) {
- latitude = location.getLatitude();
- longitude = location.getLongitude();
- }
- }
- }
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return location;
- }
-
- /**
- * Stop using GPS listener
- * Calling this function will stop using GPS in your app
- */
- public void stopUsingGPS(){
- if(locationManager != null){
- locationManager.removeUpdates(GPSTracker.this);
- }
- }
-
- /**
- * Function to get latitude
- */
- public double getLatitude(){
- if(location != null){
- latitude = location.getLatitude();
- }
-
- // return latitude
- return latitude;
- }
-
- /**
- * Function to get longitude
- */
- public double getLongitude(){
- if(location != null){
- longitude = location.getLongitude();
- }
-
- // return longitude
- return longitude;
- }
-
- /**
- * Function to check GPS/wifi enabled
- * @return boolean
- */
- public boolean canGetLocation() {
- return this.canGetLocation;
- }
-
- /**
- * Function to show settings alert dialog
- * On pressing Settings button will lauch Settings Options
- */
- public void showSettingsAlert(){
- AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
-
- // Setting Dialog Title
- alertDialog.setTitle("GPS is settings");
-
- // Setting Dialog Message
- alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
-
- // On pressing Settings button
- alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,int which) {
- Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
- mContext.startActivity(intent);
- }
- });
-
- // on pressing cancel button
- alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.cancel();
- }
- });
-
- // Showing Alert Message
- alertDialog.show();
- }
-
- @Override
- public void onLocationChanged(Location location) {
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- }
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
-
- @Override
- public IBinder onBind(Intent arg0) {
- return null;
- }
-}
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 deleted file mode 100644 index 2e08a91..0000000 --- a/misc/client/gps-demo/AndroidGPSTracking/src/com/example/gpstracking/Tracker.java +++ /dev/null @@ -1,33 +0,0 @@ -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); - } - } -} |