diff --git a/LocationLib/.classpath b/LocationLib/.classpath
new file mode 100644
index 0000000..d36f6d9
--- /dev/null
+++ b/LocationLib/.classpath
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/.codepro/deadCodeEntryPoints.xml b/LocationLib/.codepro/deadCodeEntryPoints.xml
new file mode 100644
index 0000000..814d580
--- /dev/null
+++ b/LocationLib/.codepro/deadCodeEntryPoints.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LocationLib/.project b/LocationLib/.project
new file mode 100644
index 0000000..e0da41e
--- /dev/null
+++ b/LocationLib/.project
@@ -0,0 +1,33 @@
+
+
+ LocationLib
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/LocationLib/.settings/org.eclipse.jdt.core.prefs b/LocationLib/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9e980b5
--- /dev/null
+++ b/LocationLib/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sun Oct 17 11:03:21 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/LocationLib/.settings/org.eclipse.php.core.prefs b/LocationLib/.settings/org.eclipse.php.core.prefs
new file mode 100644
index 0000000..258a35b
--- /dev/null
+++ b/LocationLib/.settings/org.eclipse.php.core.prefs
@@ -0,0 +1,3 @@
+#Thu Jul 28 09:55:58 EDT 2011
+eclipse.preferences.version=1
+include_path=
diff --git a/LocationLib/AndroidManifest.xml b/LocationLib/AndroidManifest.xml
new file mode 100644
index 0000000..50c6226
--- /dev/null
+++ b/LocationLib/AndroidManifest.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$attr.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$attr.class
new file mode 100644
index 0000000..ab2f0e9
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$attr.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$drawable.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$drawable.class
new file mode 100644
index 0000000..3d50a4b
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$drawable.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$id.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$id.class
new file mode 100644
index 0000000..cd08410
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$id.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$layout.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$layout.class
new file mode 100644
index 0000000..53a84e8
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$layout.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$string.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$string.class
new file mode 100644
index 0000000..aec304c
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R$string.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R.class
new file mode 100644
index 0000000..fe87f4b
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/R.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$1.class
new file mode 100644
index 0000000..8ff0b68
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$2.class
new file mode 100644
index 0000000..aca0d79
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$3.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$3.class
new file mode 100644
index 0000000..de07fbb
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$3.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$XPScallback.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$XPScallback.class
new file mode 100644
index 0000000..9cec317
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook$XPScallback.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook.class
new file mode 100644
index 0000000..cb4a111
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHook.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookRegistration.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookRegistration.class
new file mode 100644
index 0000000..1a4d872
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookRegistration.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$1.class
new file mode 100644
index 0000000..291ccb6
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$2.class
new file mode 100644
index 0000000..0007882
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService.class
new file mode 100644
index 0000000..9885271
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookService.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$1.class
new file mode 100644
index 0000000..8272a97
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2$1.class
new file mode 100644
index 0000000..ef4994a
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2.class
new file mode 100644
index 0000000..17f888f
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.class
new file mode 100644
index 0000000..8a9c7e5
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$1.class
new file mode 100644
index 0000000..9b74cf8
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$2.class
new file mode 100644
index 0000000..f4bed6f
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash.class b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash.class
new file mode 100644
index 0000000..a86f238
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/SkyHook/Splash.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/debug/Debug.class b/LocationLib/bin/classes/com/TwentyCodes/android/debug/Debug.class
new file mode 100644
index 0000000..1c5fe83
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/debug/Debug.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.class b/LocationLib/bin/classes/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.class
new file mode 100644
index 0000000..602e0e3
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/AndroidGPS.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/AndroidGPS.class
new file mode 100644
index 0000000..b40dabc
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/AndroidGPS.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompasOverlay.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompasOverlay.class
new file mode 100644
index 0000000..b08072a
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompasOverlay.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassListener.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassListener.class
new file mode 100644
index 0000000..3447f73
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassListener.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$1.class
new file mode 100644
index 0000000..bb5a5b0
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$2.class
new file mode 100644
index 0000000..54e0444
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$SensorCallBack.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$SensorCallBack.class
new file mode 100644
index 0000000..1b25e47
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor$SensorCallBack.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor.class
new file mode 100644
index 0000000..5dedab4
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/CompassSensor.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoPointLocationListener.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoPointLocationListener.class
new file mode 100644
index 0000000..1fc5a88
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoPointLocationListener.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoUtils.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoUtils.class
new file mode 100644
index 0000000..0e425cf
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/GeoUtils.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationReceiver.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationReceiver.class
new file mode 100644
index 0000000..7a41c74
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationReceiver.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$1.class
new file mode 100644
index 0000000..4db1725
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$2.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$2.class
new file mode 100644
index 0000000..28c6bc6
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService$2.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService.class
new file mode 100644
index 0000000..71d3734
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/LocationService.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/MapView.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/MapView.class
new file mode 100644
index 0000000..59e8bdb
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/MapView.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/MidPoint.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/MidPoint.class
new file mode 100644
index 0000000..b159550
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/MidPoint.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/ReverseGeocoder.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/ReverseGeocoder.class
new file mode 100644
index 0000000..3cd5f2d
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/ReverseGeocoder.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1$1.class
new file mode 100644
index 0000000..76cf60b
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1.class
new file mode 100644
index 0000000..866e533
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay$1.class differ
diff --git a/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay.class b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay.class
new file mode 100644
index 0000000..1ab7da5
Binary files /dev/null and b/LocationLib/bin/classes/com/TwentyCodes/android/location/UserOverlay.class differ
diff --git a/LocationLib/bin/locationlib.jar b/LocationLib/bin/locationlib.jar
new file mode 100644
index 0000000..a9a72ab
Binary files /dev/null and b/LocationLib/bin/locationlib.jar differ
diff --git a/LocationLib/bin/res/drawable/compass.png b/LocationLib/bin/res/drawable/compass.png
new file mode 100644
index 0000000..87848e5
Binary files /dev/null and b/LocationLib/bin/res/drawable/compass.png differ
diff --git a/LocationLib/bin/res/drawable/logoidea3.png b/LocationLib/bin/res/drawable/logoidea3.png
new file mode 100644
index 0000000..fdc73c3
Binary files /dev/null and b/LocationLib/bin/res/drawable/logoidea3.png differ
diff --git a/LocationLib/bin/res/drawable/needle.png b/LocationLib/bin/res/drawable/needle.png
new file mode 100644
index 0000000..93fad78
Binary files /dev/null and b/LocationLib/bin/res/drawable/needle.png differ
diff --git a/LocationLib/bin/res/drawable/skyhook_logo_alpha.png b/LocationLib/bin/res/drawable/skyhook_logo_alpha.png
new file mode 100644
index 0000000..d5ce291
Binary files /dev/null and b/LocationLib/bin/res/drawable/skyhook_logo_alpha.png differ
diff --git a/LocationLib/bin/res/drawable/skyhook_logo_alpha_small.png b/LocationLib/bin/res/drawable/skyhook_logo_alpha_small.png
new file mode 100644
index 0000000..8058c19
Binary files /dev/null and b/LocationLib/bin/res/drawable/skyhook_logo_alpha_small.png differ
diff --git a/LocationLib/bin/res/drawable/tc_logo_complete.png b/LocationLib/bin/res/drawable/tc_logo_complete.png
new file mode 100644
index 0000000..073970c
Binary files /dev/null and b/LocationLib/bin/res/drawable/tc_logo_complete.png differ
diff --git a/LocationLib/bin/res/drawable/user.png b/LocationLib/bin/res/drawable/user.png
new file mode 100644
index 0000000..579f876
Binary files /dev/null and b/LocationLib/bin/res/drawable/user.png differ
diff --git a/LocationLib/bin/res/drawable/user_arrow_animation_1.png b/LocationLib/bin/res/drawable/user_arrow_animation_1.png
new file mode 100644
index 0000000..9c6778e
Binary files /dev/null and b/LocationLib/bin/res/drawable/user_arrow_animation_1.png differ
diff --git a/LocationLib/bin/res/drawable/user_arrow_animation_2.png b/LocationLib/bin/res/drawable/user_arrow_animation_2.png
new file mode 100644
index 0000000..630fd72
Binary files /dev/null and b/LocationLib/bin/res/drawable/user_arrow_animation_2.png differ
diff --git a/LocationLib/bin/res/drawable/user_arrow_animation_3.png b/LocationLib/bin/res/drawable/user_arrow_animation_3.png
new file mode 100644
index 0000000..c1448f7
Binary files /dev/null and b/LocationLib/bin/res/drawable/user_arrow_animation_3.png differ
diff --git a/LocationLib/change log b/LocationLib/change log
new file mode 100644
index 0000000..5df2977
--- /dev/null
+++ b/LocationLib/change log
@@ -0,0 +1,5 @@
+refs #205
+
+merged with current main branch to update
+
+created SkyHookUserOverlay.setCompassDrawables() to allow client applications to set the compass drawables and location
\ No newline at end of file
diff --git a/LocationLib/doc/allclasses-frame.html b/LocationLib/doc/allclasses-frame.html
new file mode 100644
index 0000000..f9f2483
--- /dev/null
+++ b/LocationLib/doc/allclasses-frame.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
diff --git a/LocationLib/doc/allclasses-noframe.html b/LocationLib/doc/allclasses-noframe.html
new file mode 100644
index 0000000..3e7998f
--- /dev/null
+++ b/LocationLib/doc/allclasses-noframe.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/GeoUtils.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/GeoUtils.html
new file mode 100644
index 0000000..50ac7bb
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/GeoUtils.html
@@ -0,0 +1,540 @@
+
+
+
+
+
+
+GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class GeoUtils
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.GeoUtils
+
+
+
+public class GeoUtils extends Object
+
+
+
+This class contains common tools for computing common geological problems
+
+
+
+
+Author:
+ ricky barrette, Google Inc.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+GeoUtils ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+static double
+bearing (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+
+ computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+static double
+bearing (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+static GeoPoint
+distanceFrom (GeoPoint point,
+ double distance)
+
+
+ Calculates a geopoint x meters away of the geopoint supplied.
+
+
+
+static double
+distanceKm (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+
+ computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+
+
+
+static double
+distanceKm (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes the distance between to p1 and p2 based on the curve of the earth
+
+
+
+static GeoPoint
+midPoint (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes a geopoint the is the central geopoint between p1 and p1
+
+
+
+static double
+radToBearing (double rad)
+
+
+ converts radians to bearing
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+EARTH_RADIUS_KM
+
+private static int EARTH_RADIUS_KM
+
+
+
+
+
+
+
+MILLION
+
+public static double MILLION
+
+
+
+
+
+
+
+minLatitude
+
+public static int minLatitude
+
+
+
+
+
+
+
+maxLatitude
+
+public static int maxLatitude
+
+
+
+
+
+
+
+minLongitude
+
+public static int minLongitude
+
+
+
+
+
+
+
+maxLongitude
+
+public static int maxLongitude
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+GeoUtils
+
+public GeoUtils ()
+
+
+
+
+
+
+
+
+
+bearing
+
+public static double bearing (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+Parameters: lat1 - source latlon1 - source lonlat2 - destination latlon2 - destination lon
+Returns: the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+
+
+bearing
+
+public static double bearing (GeoPoint p1,
+ GeoPoint p2)
+
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+Parameters: p1 - source geopointp2 - destination geopoint
+Returns: the bearing of p2 in relationship from p1 in degrees East
+
+
+
+
+
+distanceFrom
+
+public static GeoPoint distanceFrom (GeoPoint point,
+ double distance)
+
+Calculates a geopoint x meters away of the geopoint supplied. The new geopoint
+ shares the same latitude as geopoint point, this way they are on the same latitude arc.
+
+
+Parameters: point - central geopointdistance - in meters from the geopoint
+Returns: geopoint that is x meters away from the geopoint supplied
+
+
+
+
+
+distanceKm
+
+public static double distanceKm (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+
+
+Parameters: lat1 - source latlon1 - source lonlat2 - destination latlon2 - destination lon
+Returns: the distance between to lat1/lon1 and lat2/lon2
+
+
+
+
+
+distanceKm
+
+public static double distanceKm (GeoPoint p1,
+ GeoPoint p2)
+
+computes the distance between to p1 and p2 based on the curve of the earth
+
+
+Parameters: p1 - p2 -
+Returns: the distance between to p1 and p2
+
+
+
+
+
+midPoint
+
+public static GeoPoint midPoint (GeoPoint p1,
+ GeoPoint p2)
+
+computes a geopoint the is the central geopoint between p1 and p1
+
+
+Parameters: p1 - first geopointp2 - second geopoint
+Returns: the central geopoint
+
+
+
+
+
+radToBearing
+
+public static double radToBearing (double rad)
+
+converts radians to bearing
+
+
+Parameters: rad -
+Returns: bearing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/Location.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Location.html
new file mode 100644
index 0000000..f0f7e0f
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Location.html
@@ -0,0 +1,459 @@
+
+
+
+
+
+
+Location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class Location
+
+java.lang.Object
+ com.skyhookwireless.wps.Location
+ com.skyhookwireless.wps.WPSLocation
+ com.TwentyCodes.android.SkyHook.Location
+
+
+All Implemented Interfaces: Serializable , Cloneable
+
+
+
+public class Location extends com.skyhookwireless.wps.WPSLocation
+
+
+
+an extension of skyhook's WPSLocation class, that allows for import / export from bundles
+
+
+
+
+Author:
+ ricky barrette
+See Also: Serialized Form
+
+
+
+
+
+
+
+
+
+
+Fields inherited from class com.skyhookwireless.wps.Location
+
+
+_sdki
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Location (Bundle data)
+
+
+ loads a location object from a bundle
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ Bundle
+toBundle ()
+
+
+ creates a bundle from a location object
+
+
+
+
+
+Methods inherited from class com.skyhookwireless.wps.WPSLocation
+
+
+_sdka, clone, getBearing, getHPE, getNAP, getNCell, getSpeed, getStreetAddress, setBearing, setHPE, setNAP, setSpeed, setStreetAddress, toString
+
+
+
+
+
+Methods inherited from class com.skyhookwireless.wps.Location
+
+
+getAltitude, getLatitude, getLongitude, getTime, hasAltitude, setAltitude, setLatitude, setLongitude, setTime
+
+
+
+
+
+
+
+
+
+
+
+
+
+LATITUDE
+
+public static final String LATITUDE
+
+
+See Also: Constant Field Values
+
+
+
+
+LONGITUDE
+
+public static final String LONGITUDE
+
+
+See Also: Constant Field Values
+
+
+
+
+TIME
+
+public static final String TIME
+
+
+See Also: Constant Field Values
+
+
+
+
+HPE
+
+public static final String HPE
+
+
+See Also: Constant Field Values
+
+
+
+
+NAP
+
+public static final String NAP
+
+
+See Also: Constant Field Values
+
+
+
+
+NCELL
+
+public static final String NCELL
+
+
+See Also: Constant Field Values
+
+
+
+
+SPEED
+
+public static final String SPEED
+
+
+See Also: Constant Field Values
+
+
+
+
+BEARING
+
+public static final String BEARING
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Location
+
+public Location (Bundle data)
+
+loads a location object from a bundle
+
+
+Parameters: bundle -
+
+
+
+
+
+
+
+
+toBundle
+
+public Bundle toBundle ()
+
+creates a bundle from a location object
+
+
+
+Returns:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/LocationReceiver.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/LocationReceiver.html
new file mode 100644
index 0000000..5dba47e
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/LocationReceiver.html
@@ -0,0 +1,356 @@
+
+
+
+
+
+
+LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class LocationReceiver
+
+java.lang.Object
+ BroadcastReceiver
+ com.TwentyCodes.android.SkyHook.LocationReceiver
+
+
+
+public abstract class LocationReceiver extends BroadcastReceiver
+
+
+
+this abstract class will be used as a template for classes wishing to receiver location updates from the skyhook location service
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+abstract void
+onLocationUpdate (Location location)
+
+
+ called when the location is updated
+
+
+
+ void
+onReceive (Context context,
+ Intent intent)
+
+
+ (non-Javadoc)
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+ACTION_UPDATE
+
+public static final String ACTION_UPDATE
+
+
+See Also: Constant Field Values
+
+
+
+
+LOCATION
+
+public static final String LOCATION
+
+
+See Also: Constant Field Values
+
+
+
+
+mContext
+
+public Context mContext
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+LocationReceiver
+
+public LocationReceiver ()
+
+
+
+
+
+
+
+
+
+onReceive
+
+public void onReceive (Context context,
+ Intent intent)
+
+(non-Javadoc)
+
+
+Parameters: context - intent - See Also: BroadcastReceiver
+
+
+
+
+
+onLocationUpdate
+
+public abstract void onLocationUpdate (Location location)
+
+called when the location is updated
+
+
+Parameters: location -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/MapView.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/MapView.html
new file mode 100644
index 0000000..6e0823c
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/MapView.html
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+MapView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class MapView
+
+java.lang.Object
+ com.google.android.maps.MapView
+ com.TwentyCodes.android.SkyHook.MapView
+
+
+
+public class MapView extends com.google.android.maps.MapView
+
+
+
+We use this MapView Because it has double tap zoom capability
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+MapView (Context context,
+ AttributeSet attrs)
+
+
+
+
+
+MapView (Context context,
+ AttributeSet attrs,
+ int defStyle)
+
+
+
+
+
+MapView (Context context,
+ String apiKey)
+
+
+
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+lastTouchTime
+
+private long lastTouchTime
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+MapView
+
+public MapView (Context context,
+ String apiKey)
+
+
+Parameters: context - apiKey -
+
+
+
+
+MapView
+
+public MapView (Context context,
+ AttributeSet attrs)
+
+
+Parameters: context - attrs -
+
+
+
+
+MapView
+
+public MapView (Context context,
+ AttributeSet attrs,
+ int defStyle)
+
+
+Parameters: context - attrs - defStyle -
+
+
+
+
+
+
+
+
+onInterceptTouchEvent
+
+public boolean onInterceptTouchEvent (MotionEvent ev)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.attr.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.attr.html
new file mode 100644
index 0000000..749d820
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.attr.html
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+R.attr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R.attr
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R.attr
+
+
+Enclosing class: R
+
+
+
+public static final class R.attr extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R.attr ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R.attr
+
+public R.attr ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.drawable.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.drawable.html
new file mode 100644
index 0000000..12226d3
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.drawable.html
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+R.drawable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R.drawable
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R.drawable
+
+
+Enclosing class: R
+
+
+
+public static final class R.drawable extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R.drawable ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+logoidea3
+
+public static final int logoidea3
+
+
+See Also: Constant Field Values
+
+
+
+
+skyhook_logo
+
+public static final int skyhook_logo
+
+
+See Also: Constant Field Values
+
+
+
+
+skyhook_logo_alpha
+
+public static final int skyhook_logo_alpha
+
+
+See Also: Constant Field Values
+
+
+
+
+skyhook_logo_alpha_small
+
+public static final int skyhook_logo_alpha_small
+
+
+See Also: Constant Field Values
+
+
+
+
+tc_logo_complete
+
+public static final int tc_logo_complete
+
+
+See Also: Constant Field Values
+
+
+
+
+user
+
+public static final int user
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R.drawable
+
+public R.drawable ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.html
new file mode 100644
index 0000000..6a09ef3
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.html
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+R
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R
+
+
+
+public final class R extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+static class
+R.attr
+
+
+
+
+
+
+static class
+R.drawable
+
+
+
+
+
+
+static class
+R.id
+
+
+
+
+
+
+static class
+R.layout
+
+
+
+
+
+
+static class
+R.string
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R
+
+public R ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.id.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.id.html
new file mode 100644
index 0000000..8c945a9
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.id.html
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+R.id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R.id
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R.id
+
+
+Enclosing class: R
+
+
+
+public static final class R.id extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+static int
+skyhook_img
+
+
+
+
+
+
+static int
+tc_img
+
+
+
+
+
+
+static int
+text
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R.id ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+skyhook_img
+
+public static final int skyhook_img
+
+
+See Also: Constant Field Values
+
+
+
+
+tc_img
+
+public static final int tc_img
+
+
+See Also: Constant Field Values
+
+
+
+
+text
+
+public static final int text
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R.id
+
+public R.id ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.layout.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.layout.html
new file mode 100644
index 0000000..446eb1b
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.layout.html
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+R.layout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R.layout
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R.layout
+
+
+Enclosing class: R
+
+
+
+public static final class R.layout extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R.layout ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+powered_by_skyhook
+
+public static final int powered_by_skyhook
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R.layout
+
+public R.layout ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.string.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.string.html
new file mode 100644
index 0000000..348c876
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/R.string.html
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+R.string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class R.string
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.R.string
+
+
+Enclosing class: R
+
+
+
+public static final class R.string extends Object
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+static int
+app_name
+
+
+
+
+
+
+static int
+hello
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+R.string ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+app_name
+
+public static final int app_name
+
+
+See Also: Constant Field Values
+
+
+
+
+hello
+
+public static final int hello
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+R.string
+
+public R.string ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/Receiver.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Receiver.html
new file mode 100644
index 0000000..b6ce4d2
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Receiver.html
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class Receiver
+
+java.lang.Object
+ BroadcastReceiver
+ com.TwentyCodes.android.SkyHook.Receiver
+
+
+
+public class Receiver extends BroadcastReceiver
+
+
+
+this class will be used to start the skyhook service and obtain a partial wake lock to prevent the phone from sleeping while we are getting the users location
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+static int
+REQUEST_CODE
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Receiver ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+onReceive (Context context,
+ Intent intent)
+
+
+ (non-Javadoc)
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+REQUEST_CODE
+
+public static final int REQUEST_CODE
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Receiver
+
+public Receiver ()
+
+
+
+
+
+
+
+
+
+onReceive
+
+public void onReceive (Context context,
+ Intent intent)
+
+(non-Javadoc)
+
+
+Parameters: context - intent - See Also: BroadcastReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.XPScallback.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.XPScallback.html
new file mode 100644
index 0000000..c07a90c
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.XPScallback.html
@@ -0,0 +1,307 @@
+
+
+
+
+
+
+SkyHook.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHook.XPScallback
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.SkyHook.XPScallback
+
+
+All Implemented Interfaces: WPSPeriodicLocationCallback
+
+
+Enclosing class: SkyHook
+
+
+
+private class SkyHook.XPScallback extends Object implements WPSPeriodicLocationCallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHook.XPScallback
+
+private SkyHook.XPScallback ()
+
+
+
+
+
+
+
+
+
+done
+
+public void done ()
+
+
+
+
+
+
+
+
+
+
+
+handleError
+
+public WPSContinuation handleError (WPSReturnCode error)
+
+
+
+
+
+
+
+
+
+
+
+handleWPSPeriodicLocation
+
+public WPSContinuation handleWPSPeriodicLocation (WPSLocation location)
+
+
+Specified by: handleWPSPeriodicLocation in interface WPSPeriodicLocationCallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.html
new file mode 100644
index 0000000..0908e38
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHook.html
@@ -0,0 +1,500 @@
+
+
+
+
+
+
+SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHook
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.SkyHook
+
+
+
+public class SkyHook extends Object
+
+
+
+this calls will be used to create skyhook object that uses an listener interface to interact with the rest of location ringer
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+SkyHook (Context context)
+
+
+ Constructors a new skyhook object
+
+
+SkyHook (Context context,
+ long period)
+
+
+ Constructors a new skyhook object
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+getLoctaion ()
+
+
+ request current user location, note that the listeners onLocationChanged() will be call multiple times.
+
+
+
+ void
+getUpdates ()
+
+
+ Attempts to register the the listener for periodic updates
+
+
+
+ void
+removeUpdates ()
+
+
+ Removes any current registration for location updates of the current activity
+ with the given LocationListener.
+
+
+
+ void
+setLocationListener (XPSLocationListener listener)
+
+
+ Used for receiving notifications from SkyHook when
+ the location has changed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+TAG
+
+public static final String TAG
+
+
+See Also: Constant Field Values
+
+
+
+
+USERNAME
+
+public static final String USERNAME
+
+
+See Also: Constant Field Values
+
+
+
+
+USERNAME_FOR_TESTING
+
+public static final String USERNAME_FOR_TESTING
+
+
+See Also: Constant Field Values
+
+
+
+
+REALM
+
+public static final String REALM
+
+
+See Also: Constant Field Values
+
+
+
+
+LOCATION_MESSAGE
+
+public static final int LOCATION_MESSAGE
+
+
+See Also: Constant Field Values
+
+
+
+
+ERROR_MESSAGE
+
+public static final int ERROR_MESSAGE
+
+
+See Also: Constant Field Values
+
+
+
+
+DONE_MESSAGE
+
+public static final int DONE_MESSAGE
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHook
+
+public SkyHook (Context context)
+
+Constructors a new skyhook object
+
+
+Parameters: context -
+
+
+
+
+SkyHook
+
+public SkyHook (Context context,
+ long period)
+
+Constructors a new skyhook object
+
+
+Parameters: context - period - between location updates in milliseconds
+
+
+
+
+
+
+
+
+getLoctaion
+
+public void getLoctaion ()
+
+request current user location, note that the listeners onLocationChanged() will be call multiple times.
+ updates will stop once an accurate location is determined.
+
+
+
+
+
+
+
+
+getUpdates
+
+public void getUpdates ()
+
+Attempts to register the the listener for periodic updates
+
+
+
+
+
+
+
+
+removeUpdates
+
+public void removeUpdates ()
+
+Removes any current registration for location updates of the current activity
+ with the given LocationListener. Following this call, updates will no longer
+ occur for this listener.
+
+
+Parameters: listener -
+
+
+
+
+
+setLocationListener
+
+public void setLocationListener (XPSLocationListener listener)
+
+Used for receiving notifications from SkyHook when
+ the location has changed. These methods are called if the
+ LocationListener has been registered with the location manager service using the method.
+
+
+Parameters: listener -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookRegistration.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookRegistration.html
new file mode 100644
index 0000000..41eb229
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookRegistration.html
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+SkyHookRegistration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHookRegistration
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+
+
+public class SkyHookRegistration extends Object
+
+
+
+this class will be used to register new users with skyhook
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHookRegistration
+
+public SkyHookRegistration (Context context)
+
+
+
+
+
+
+
+
+
+registerNewUser
+
+public void registerNewUser (RegistrationCallback listener)
+
+attempts to register the user by their cell #
+
+ TODO hash cell number for privacy
+
+
+Parameters: listener - for call back methods
+
+
+
+
+
+getUserName
+
+public static String getUserName (Context context)
+
+returns the users username
+
+
+Parameters: context -
+Returns:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.XPScallback.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.XPScallback.html
new file mode 100644
index 0000000..4090489
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.XPScallback.html
@@ -0,0 +1,331 @@
+
+
+
+
+
+
+SkyHookService.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHookService.XPScallback
+
+java.lang.Object
+ com.TwentyCodes.android.SkyHook.SkyHookService.XPScallback
+
+
+All Implemented Interfaces: RegistrationCallback , WPSPeriodicLocationCallback
+
+
+Enclosing class: SkyHookService
+
+
+
+private class SkyHookService.XPScallback extends Object implements WPSPeriodicLocationCallback , RegistrationCallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHookService.XPScallback
+
+private SkyHookService.XPScallback ()
+
+
+
+
+
+
+
+
+
+done
+
+public void done ()
+
+
+
+
+
+
+
+
+
+
+
+handleError
+
+public WPSContinuation handleError (WPSReturnCode error)
+
+
+
+
+
+
+
+
+
+
+
+handleWPSPeriodicLocation
+
+public WPSContinuation handleWPSPeriodicLocation (WPSLocation location)
+
+
+Specified by: handleWPSPeriodicLocation in interface WPSPeriodicLocationCallback
+
+
+
+
+
+
+
+
+handleSuccess
+
+public void handleSuccess ()
+
+(non-Javadoc)
+
+
+Specified by: handleSuccess in interface RegistrationCallback
+
+
+See Also: RegistrationCallback.handleSuccess()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.html
new file mode 100644
index 0000000..88c52d9
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookService.html
@@ -0,0 +1,476 @@
+
+
+
+
+
+
+SkyHookService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHookService
+
+java.lang.Object
+ Service
+ com.TwentyCodes.android.SkyHook.SkyHookService
+
+
+
+public class SkyHookService extends Service
+
+
+
+this will be a service that will retrieve periodic updates on the users location
+
+
+
+
+Author:
+ Ricky Barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ Location
+convertLocation ()
+
+
+ converts skyhook's location object into android's location object
+
+
+
+ IBinder
+onBind (Intent arg0)
+
+
+ (non-Javadoc)
+
+
+
+ void
+onCreate ()
+
+
+
+
+
+
+ void
+onDestroy ()
+
+
+ aborts location services
+ (non-Javadoc)
+
+
+
+ void
+onStart (Intent intent,
+ int startId)
+
+
+ To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+
+
+
+ int
+onStartCommand (Intent intent,
+ int flags,
+ int startId)
+
+
+ This method is called when startService is called.
+
+
+
+static Runnable
+startService (Context context,
+ long period)
+
+
+ a convince method for starting the service.
+
+
+
+static Runnable
+stopService (Context context)
+
+
+ a convince method for stopping the service
+
+
+
+
+
+
+
+
+
+
+
+
+
+PERIOD_BETWEEN_UPDATES
+
+public static final String PERIOD_BETWEEN_UPDATES
+
+
+See Also: Constant Field Values
+
+
+
+
+TAG
+
+public static final String TAG
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHookService
+
+public SkyHookService ()
+
+
+
+
+
+
+
+
+
+convertLocation
+
+public Location convertLocation ()
+
+converts skyhook's location object into android's location object
+
+
+
+Returns: converted location
+
+
+
+
+
+onBind
+
+public IBinder onBind (Intent arg0)
+
+(non-Javadoc)
+
+
+Parameters: arg0 -
+Returns: See Also: Service
+
+
+
+
+
+onCreate
+
+public void onCreate ()
+
+
+
+
+
+
+
+
+onDestroy
+
+public void onDestroy ()
+
+aborts location services
+ (non-Javadoc)
+
+
+See Also: Service
+
+
+
+
+
+onStart
+
+public void onStart (Intent intent,
+ int startId)
+
+To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+
+
+
+
+
+
+
+
+onStartCommand
+
+public int onStartCommand (Intent intent,
+ int flags,
+ int startId)
+
+This method is called when startService is called. only used in 2.x android.
+
+
+
+
+
+
+
+
+startService
+
+public static Runnable startService (Context context,
+ long period)
+
+a convince method for starting the service. 1 minute = 60 000 milliseconds
+
+
+Parameters: context - period - between updates in milliseconds
+Returns: a runnable that will start the service
+
+
+
+
+
+stopService
+
+public static Runnable stopService (Context context)
+
+a convince method for stopping the service
+
+
+Parameters: context -
+Returns: a runnable that will stop the service
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.html
new file mode 100644
index 0000000..8fec0d5
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.html
@@ -0,0 +1,585 @@
+
+
+
+
+
+
+SkyHookUserOverlay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class SkyHookUserOverlay
+
+java.lang.Object
+ Overlay
+ com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+
+
+All Implemented Interfaces: XPSLocationListener
+
+
+
+public class SkyHookUserOverlay extends Overlayimplements XPSLocationListener
+
+
+
+this class will be used to the users location on the map using skyhook's call back methods
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+SkyHookUserOverlay (MapView mapView,
+ Context context)
+
+
+ Construct a new SkyHookUserOverlaymFollowUser
+
+
+SkyHookUserOverlay (MapView mapView,
+ Context context,
+ boolean followUser)
+
+
+ Construct a new SkyHookUserOverlay
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+disableMyLocation ()
+
+
+ Stops location updates and removes the overlay from view
+
+
+
+ void
+draw (Canvas canvas,
+ MapView mapView,
+ boolean shadow)
+
+
+ we override this methods so we can provide a drawable and a location to draw on the canvas.
+
+
+
+ void
+enableMyLocation ()
+
+
+ Attempts to enable MyLocation, registering for updates from sky hook
+
+
+
+ void
+followUser (boolean followUser)
+
+
+ Allows the map to follow the user
+
+
+
+ float
+getUserBearing ()
+
+
+ returns the users current bearing
+
+
+
+ GeoPoint
+getUserLocation ()
+
+
+ returns the users current location
+
+
+
+ void
+onAccuracyChanged (Sensor sensor,
+ int accuracy)
+
+
+ Called when the accuracy of a sensor has changed.
+
+
+
+ void
+onSensorChanged (SensorEvent event)
+
+
+ Called when sensor values have changed.
+
+
+
+ void
+onXPSLocationChanged (GeoPoint point,
+ int accuracy)
+
+
+ called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle.
+
+
+
+ void
+registerListener (XPSLocationListener listener)
+
+
+ Attempts to register the listener for location updates
+
+
+
+ void
+unRegisterListener ()
+
+
+ UnResgisters the listener.
+
+
+
+
+
+
+
+
+
+
+
+
+
+isFollowingUser
+
+public boolean isFollowingUser
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+SkyHookUserOverlay
+
+public SkyHookUserOverlay (MapView mapView,
+ Context context)
+
+Construct a new SkyHookUserOverlaymFollowUser
+
+
+Parameters: mapView - context -
+
+
+
+
+SkyHookUserOverlay
+
+public SkyHookUserOverlay (MapView mapView,
+ Context context,
+ boolean followUser)
+
+Construct a new SkyHookUserOverlay
+
+
+Parameters: mapView - context - followUser -
+
+
+
+
+
+
+
+
+disableMyLocation
+
+public void disableMyLocation ()
+
+Stops location updates and removes the overlay from view
+
+
+
+
+
+
+
+
+
+
+
+draw
+
+public void draw (Canvas canvas,
+ MapView mapView,
+ boolean shadow)
+
+we override this methods so we can provide a drawable and a location to draw on the canvas.
+ (non-Javadoc)
+
+
+
+
+
+Parameters: canvas - mapView - shadow - See Also: Overlay
+
+
+
+
+
+enableMyLocation
+
+public void enableMyLocation ()
+
+Attempts to enable MyLocation, registering for updates from sky hook
+
+
+
+
+
+
+
+
+
+
+
+followUser
+
+public void followUser (boolean followUser)
+
+Allows the map to follow the user
+
+
+
+
+
+Parameters: followUser -
+
+
+
+
+
+getUserBearing
+
+public float getUserBearing ()
+
+returns the users current bearing
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+getUserLocation
+
+public GeoPoint getUserLocation ()
+
+returns the users current location
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+onAccuracyChanged
+
+public void onAccuracyChanged (Sensor sensor,
+ int accuracy)
+
+Called when the accuracy of a sensor has changed.
+
+
+
+
+
+Parameters: sensor - accuracy - See Also: SensorEventListener
+
+
+
+
+
+onXPSLocationChanged
+
+public void onXPSLocationChanged (GeoPoint point,
+ int accuracy)
+
+called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle.
+ (non-Javadoc)
+
+
+Specified by: onXPSLocationChanged in interface XPSLocationListener
+
+
+Parameters: point - accuracy - See Also: com.TwentyCodes.android.SkyHook.XPSLocationListener.location.LocationListener#onXPSLocationChanged(com.google.android.maps.GeoPoint, float)
+
+
+
+
+
+onSensorChanged
+
+public void onSensorChanged (SensorEvent event)
+
+Called when sensor values have changed.
+
+
+
+
+
+Parameters: event - See Also: SensorEventListener
+
+
+
+
+
+registerListener
+
+public void registerListener (XPSLocationListener listener)
+
+Attempts to register the listener for location updates
+
+
+
+
+
+Parameters: listener -
+
+
+
+
+
+unRegisterListener
+
+public void unRegisterListener ()
+
+UnResgisters the listener. after this call you will no longer get location updates
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/Splash.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Splash.html
new file mode 100644
index 0000000..d0b333a
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/Splash.html
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+Splash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Class Splash
+
+java.lang.Object
+ Activity
+ com.TwentyCodes.android.SkyHook.Splash
+
+
+
+public class Splash extends Activity
+
+
+
+this activity will be used to display the Twenty Codes, LLC and Skyhook Wireless Splash Screen
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Splash ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+onCreate (Bundle savedInstanceState)
+
+
+
+
+
+
+static Runnable
+showSpashScreen (Context context)
+
+
+ a convince method for starting the splash screen activity
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Splash
+
+public Splash ()
+
+
+
+
+
+
+
+
+
+onCreate
+
+public void onCreate (Bundle savedInstanceState)
+
+
+
+
+
+
+
+
+showSpashScreen
+
+public static Runnable showSpashScreen (Context context)
+
+a convince method for starting the splash screen activity
+
+
+Parameters: context -
+Returns: a runnable that will start the splash screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/XPSLocationListener.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/XPSLocationListener.html
new file mode 100644
index 0000000..4e70908
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/XPSLocationListener.html
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+XPSLocationListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+Interface XPSLocationListener
+
+All Known Implementing Classes: SkyHookUserOverlay
+
+
+
+public interface XPSLocationListener
+
+
+
+this interface will be used to interface with skyhook sdk with the rest of the application
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+onXPSLocationChanged (GeoPoint point,
+ int accuracy)
+
+
+ Called when the location has changed
+
+
+
+
+
+
+
+
+
+
+
+onXPSLocationChanged
+
+void onXPSLocationChanged (GeoPoint point,
+ int accuracy)
+
+Called when the location has changed
+
+
+Parameters: point - accuracy -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/GeoUtils.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/GeoUtils.html
new file mode 100644
index 0000000..d9a66d1
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/GeoUtils.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.GeoUtils
+
+No usage of com.TwentyCodes.android.SkyHook.GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Location.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Location.html
new file mode 100644
index 0000000..ee756d3
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Location.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/LocationReceiver.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/LocationReceiver.html
new file mode 100644
index 0000000..a5c9cb7
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/LocationReceiver.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.LocationReceiver
+
+No usage of com.TwentyCodes.android.SkyHook.LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/MapView.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/MapView.html
new file mode 100644
index 0000000..cc6022d
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/MapView.html
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.MapView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.MapView
+
+
+
+
+
+
+
+
+
+
+
+
+Methods in com.TwentyCodes.android.SkyHook with parameters of type MapView
+
+
+
+ void
+SkyHookUserOverlay. draw (Canvas canvas,
+ MapView mapView,
+ boolean shadow)
+
+
+ we override this methods so we can provide a drawable and a location to draw on the canvas.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.attr.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.attr.html
new file mode 100644
index 0000000..a516797
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.attr.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.attr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.attr
+
+No usage of com.TwentyCodes.android.SkyHook.R.attr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.drawable.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.drawable.html
new file mode 100644
index 0000000..b38b165
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.drawable.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.drawable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.drawable
+
+No usage of com.TwentyCodes.android.SkyHook.R.drawable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.html
new file mode 100644
index 0000000..9fe2f87
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R
+
+No usage of com.TwentyCodes.android.SkyHook.R
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.id.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.id.html
new file mode 100644
index 0000000..fc88119
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.id.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.id
+
+No usage of com.TwentyCodes.android.SkyHook.R.id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.layout.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.layout.html
new file mode 100644
index 0000000..b61865d
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.layout.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.layout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.layout
+
+No usage of com.TwentyCodes.android.SkyHook.R.layout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.string.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.string.html
new file mode 100644
index 0000000..826e6b5
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/R.string.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.R.string
+
+No usage of com.TwentyCodes.android.SkyHook.R.string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Receiver.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Receiver.html
new file mode 100644
index 0000000..cf24538
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Receiver.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Receiver
+
+No usage of com.TwentyCodes.android.SkyHook.Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.XPScallback.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.XPScallback.html
new file mode 100644
index 0000000..d29091a
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.XPScallback.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHook.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHook.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.html
new file mode 100644
index 0000000..eb4d91e
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHook.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHook
+
+No usage of com.TwentyCodes.android.SkyHook.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookRegistration.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookRegistration.html
new file mode 100644
index 0000000..2e5b44d
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookRegistration.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+No usage of com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.XPScallback.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.XPScallback.html
new file mode 100644
index 0000000..f29003c
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.XPScallback.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookService.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookService.XPScallback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.html
new file mode 100644
index 0000000..3a6be9a
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookService.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookService
+
+No usage of com.TwentyCodes.android.SkyHook.SkyHookService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookUserOverlay.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookUserOverlay.html
new file mode 100644
index 0000000..eff6a0b
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/SkyHookUserOverlay.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+
+No usage of com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Splash.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Splash.html
new file mode 100644
index 0000000..e4a8fb2
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/Splash.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Splash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.SkyHook.Splash
+
+No usage of com.TwentyCodes.android.SkyHook.Splash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/XPSLocationListener.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/XPSLocationListener.html
new file mode 100644
index 0000000..c1c8312
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/class-use/XPSLocationListener.html
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+Uses of Interface com.TwentyCodes.android.SkyHook.XPSLocationListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Interface com.TwentyCodes.android.SkyHook.XPSLocationListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-frame.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-frame.html
new file mode 100644
index 0000000..8130394
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-frame.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-summary.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-summary.html
new file mode 100644
index 0000000..11990fc
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-summary.html
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Package com.TwentyCodes.android.SkyHook
+
+
+
+
+
+Interface Summary
+
+
+XPSLocationListener
+this interface will be used to interface with skyhook sdk with the rest of the application
+
+
+
+
+
+
+
+
+
+Class Summary
+
+
+R
+
+
+
+R.attr
+
+
+
+R.drawable
+
+
+
+R.id
+
+
+
+R.layout
+
+
+
+R.string
+
+
+
+SkyHook
+this calls will be used to create skyhook object that uses an listener interface to interact with the rest of location ringer
+
+
+SkyHookRegistration
+this class will be used to register new users with skyhook
+
+
+SkyHookService
+this will be a service that will retrieve periodic updates on the users location
+
+
+SkyHookUserOverlay
+this class will be used to the users location on the map using skyhook's call back methods
+
+
+Splash
+this activity will be used to display the Twenty Codes, LLC and Skyhook Wireless Splash Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-tree.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-tree.html
new file mode 100644
index 0000000..85e96df
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-tree.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For Package com.TwentyCodes.android.SkyHook
+
+
+
+Package Hierarchies: All Packages
+
+
+Class Hierarchy
+
+
+java.lang.Object
+Activity
+com.TwentyCodes.android.SkyHook.Splash
+ Overlay
+ com.TwentyCodes.android.SkyHook.R com.TwentyCodes.android.SkyHook.R.attr com.TwentyCodes.android.SkyHook.R.drawable com.TwentyCodes.android.SkyHook.R.id com.TwentyCodes.android.SkyHook.R.layout com.TwentyCodes.android.SkyHook.R.string Service
+ com.TwentyCodes.android.SkyHook.SkyHook com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+
+Interface Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-use.html b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-use.html
new file mode 100644
index 0000000..a1da80b
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/SkyHook/package-use.html
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+Uses of Package com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Package com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/GeoUtils.html b/LocationLib/doc/com/TwentyCodes/android/location/GeoUtils.html
new file mode 100644
index 0000000..7ebbcf4
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/GeoUtils.html
@@ -0,0 +1,502 @@
+
+
+
+
+
+
+GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class GeoUtils
+
+java.lang.Object
+ com.TwentyCodes.android.location.GeoUtils
+
+
+
+public class GeoUtils extends Object
+
+
+
+This class contains common tools for computing common geological problems
+
+
+
+
+Author:
+ ricky barrette, Google Inc.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+GeoUtils ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+static double
+bearing (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+
+ computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+static double
+bearing (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+static GeoPoint
+distanceFrom (GeoPoint point,
+ double distance)
+
+
+ Calculates a geopoint x meters away of the geopoint supplied.
+
+
+
+static double
+distanceKm (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+
+ computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+
+
+
+static double
+distanceKm (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes the distance between to p1 and p2 based on the curve of the earth
+
+
+
+static boolean
+isIntersecting (GeoPoint userPoint,
+ float accuracyRadius,
+ GeoPoint locationPoint,
+ float locationRadius,
+ float fudgeFactor)
+
+
+ a convince method for testing if 2 circles on the the surface of the earth intersect.
+
+
+
+static MidPoint
+midPoint (GeoPoint p1,
+ GeoPoint p2)
+
+
+ computes a geopoint the is the central geopoint between p1 and p1
+
+
+
+static double
+radToBearing (double rad)
+
+
+ converts radians to bearing
+
+
+
+
+
+
+
+
+
+
+
+
+
+EARTH_RADIUS_KM
+
+public static final int EARTH_RADIUS_KM
+
+
+See Also: Constant Field Values
+
+
+
+
+MILLION
+
+public static final double MILLION
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+GeoUtils
+
+public GeoUtils ()
+
+
+
+
+
+
+
+
+
+bearing
+
+public static double bearing (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+Parameters: lat1 - source latlon1 - source lonlat2 - destination latlon2 - destination lon
+Returns: the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+
+
+bearing
+
+public static double bearing (GeoPoint p1,
+ GeoPoint p2)
+
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+Parameters: p1 - source geopointp2 - destination geopoint
+Returns: the bearing of p2 in relationship from p1 in degrees East
+
+
+
+
+
+distanceFrom
+
+public static GeoPoint distanceFrom (GeoPoint point,
+ double distance)
+
+Calculates a geopoint x meters away of the geopoint supplied. The new geopoint
+ shares the same latitude as geopoint point, this way they are on the same latitude arc.
+
+
+Parameters: point - central geopointdistance - in meters from the geopoint
+Returns: geopoint that is x meters away from the geopoint supplied
+
+
+
+
+
+distanceKm
+
+public static double distanceKm (double lat1,
+ double lon1,
+ double lat2,
+ double lon2)
+
+computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+
+
+Parameters: lat1 - source latlon1 - source lonlat2 - destination latlon2 - destination lon
+Returns: the distance between to lat1/lon1 and lat2/lon2
+
+
+
+
+
+isIntersecting
+
+public static boolean isIntersecting (GeoPoint userPoint,
+ float accuracyRadius,
+ GeoPoint locationPoint,
+ float locationRadius,
+ float fudgeFactor)
+
+a convince method for testing if 2 circles on the the surface of the earth intersect.
+ we will use this method to test if the users accuracy circle intersects a marked locaton's radius
+ if ( (accuracyCircleRadius + locationRadius) - fudgeFactor) > acos(sin(lat1Rad)sin(lat2Rad)+cos(lat1Rad)cos(lat2Rad)cos(lon2Rad-lon1Rad)6371
+
+
+Parameters: userPoint - accuracyRadius - in KMlocationPoint - locationRadius - in KMfudgeFactor - how many KM the circles have to intersect
+Returns: true if the circles intersect
+
+
+
+
+
+distanceKm
+
+public static double distanceKm (GeoPoint p1,
+ GeoPoint p2)
+
+computes the distance between to p1 and p2 based on the curve of the earth
+
+
+Parameters: p1 - p2 -
+Returns: the distance between to p1 and p2
+
+
+
+
+
+midPoint
+
+public static MidPoint midPoint (GeoPoint p1,
+ GeoPoint p2)
+
+computes a geopoint the is the central geopoint between p1 and p1
+
+
+Parameters: p1 - first geopointp2 - second geopoint
+Returns: a MidPoint object
+
+
+
+
+
+radToBearing
+
+public static double radToBearing (double rad)
+
+converts radians to bearing
+
+
+Parameters: rad -
+Returns: bearing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/LocationReceiver.html b/LocationLib/doc/com/TwentyCodes/android/location/LocationReceiver.html
new file mode 100644
index 0000000..e6dc61a
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/LocationReceiver.html
@@ -0,0 +1,358 @@
+
+
+
+
+
+
+LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class LocationReceiver
+
+java.lang.Object
+ BroadcastReceiver
+ com.TwentyCodes.android.location.LocationReceiver
+
+
+
+public abstract class LocationReceiver extends BroadcastReceiver
+
+
+
+this abstract class will be used as a template for classes wishing to receiver location updates from the skyhook location service
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+abstract void
+onLocationUpdate (Location location)
+
+
+ called when a location update is received
+
+
+
+ void
+onReceive (Context context,
+ Intent intent)
+
+
+ (non-Javadoc)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ACTION_UPDATE
+
+public static final String ACTION_UPDATE
+
+
+See Also: Constant Field Values
+
+
+
+
+LOCATION_PARCEL
+
+public static final String LOCATION_PARCEL
+
+
+See Also: Constant Field Values
+
+
+
+
+mContext
+
+public Context mContext
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+LocationReceiver
+
+public LocationReceiver ()
+
+
+
+
+
+
+
+
+
+onReceive
+
+public void onReceive (Context context,
+ Intent intent)
+
+(non-Javadoc)
+
+
+Parameters: contextonBind - intent - See Also: BroadcastReceiver
+
+
+
+
+
+onLocationUpdate
+
+public abstract void onLocationUpdate (Location location)
+
+called when a location update is received
+
+
+Parameters: parcelableExtra -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/LocationService.html b/LocationLib/doc/com/TwentyCodes/android/location/LocationService.html
new file mode 100644
index 0000000..f1ee033
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/LocationService.html
@@ -0,0 +1,545 @@
+
+
+
+
+
+
+LocationService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class LocationService
+
+java.lang.Object
+ Service
+ com.TwentyCodes.android.location.LocationService
+
+
+
+public class LocationService extends Service
+
+
+
+this service class will be used broadcast the users location periodic
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ IBinder
+onBind (Intent arg0)
+
+
+ (non-Javadoc)
+
+
+
+ void
+onCreate ()
+
+
+ called when the service is created.
+
+
+
+ void
+onDestroy ()
+
+
+ called when the service is destroyed.
+
+
+
+ void
+onLocationChanged (Location location)
+
+
+ (non-Javadoc)
+
+
+
+ void
+onProviderDisabled (String arg0)
+
+
+ (non-Javadoc)
+
+
+
+ void
+onProviderEnabled (String arg0)
+
+
+ (non-Javadoc)
+
+
+
+ void
+onStart (Intent intent,
+ int startId)
+
+
+ To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+
+
+
+ int
+onStartCommand (Intent intent,
+ int flags,
+ int startId)
+
+
+ This method is called when startService is called.
+
+
+
+ void
+onStatusChanged (String arg0,
+ int arg1,
+ Bundle arg2)
+
+
+ (non-Javadoc)
+
+
+
+static Runnable
+startService (Context context,
+ long period)
+
+
+ a convince method for starting the service.
+
+
+
+static Runnable
+stopService (Context context)
+
+
+ a convince method for stopping the service
+
+
+
+
+
+
+
+
+
+
+
+
+
+TAG
+
+public static final String TAG
+
+
+See Also: Constant Field Values
+
+
+
+
+PERIOD_BETWEEN_UPDATES
+
+public static final String PERIOD_BETWEEN_UPDATES
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+LocationService
+
+public LocationService ()
+
+
+
+
+
+
+
+
+
+onCreate
+
+public void onCreate ()
+
+called when the service is created. this will initialize the location manager, and acquire a wakelock
+ (non-Javadoc)
+
+
+See Also: Service
+
+
+
+
+
+onDestroy
+
+public void onDestroy ()
+
+called when the service is destroyed.
+ this will remove any wakelock or location service running, and register to be waken back up
+ (non-Javadoc)
+
+
+See Also: Service
+
+
+
+
+
+onLocationChanged
+
+public void onLocationChanged (Location location)
+
+(non-Javadoc)
+
+
+Parameters: location - See Also: LocationListener
+
+
+
+
+
+onProviderDisabled
+
+public void onProviderDisabled (String arg0)
+
+(non-Javadoc)
+
+
+Parameters: arg0 - See Also: LocationListener
+
+
+
+
+
+onProviderEnabled
+
+public void onProviderEnabled (String arg0)
+
+(non-Javadoc)
+
+
+Parameters: arg0 - See Also: LocationListener
+
+
+
+
+
+onStart
+
+public void onStart (Intent intent,
+ int startId)
+
+To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+
+
+
+
+
+
+
+
+onStartCommand
+
+public int onStartCommand (Intent intent,
+ int flags,
+ int startId)
+
+This method is called when startService is called. only used in 2.x android.
+
+
+
+
+
+
+
+
+onStatusChanged
+
+public void onStatusChanged (String arg0,
+ int arg1,
+ Bundle arg2)
+
+(non-Javadoc)
+
+
+Parameters: arg0 - arg1 - arg2 - See Also: LocationListener
+
+
+
+
+
+onBind
+
+public IBinder onBind (Intent arg0)
+
+(non-Javadoc)
+
+
+Parameters: arg0 -
+Returns: See Also: Service
+
+
+
+
+
+startService
+
+public static Runnable startService (Context context,
+ long period)
+
+a convince method for starting the service. 1 minute = 60 000 milliseconds
+
+
+Parameters: context - period - between updates in milliseconds
+Returns: a runnable that will start the service
+
+
+
+
+
+stopService
+
+public static Runnable stopService (Context context)
+
+a convince method for stopping the service
+
+
+Parameters: context -
+Returns: a runnable that will stop the service
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/MapView.html b/LocationLib/doc/com/TwentyCodes/android/location/MapView.html
new file mode 100644
index 0000000..70b0090
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/MapView.html
@@ -0,0 +1,303 @@
+
+
+
+
+
+
+MapView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class MapView
+
+java.lang.Object
+ com.google.android.maps.MapView
+ com.TwentyCodes.android.location.MapView
+
+
+
+public class MapView extends MapView
+
+
+
+We use this MapView Because it has double tap zoom capability
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+MapView (Context context,
+ AttributeSet attrs)
+
+
+
+
+
+MapView (Context context,
+ AttributeSet attrs,
+ int defStyle)
+
+
+
+
+
+MapView (Context context,
+ String apiKey)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+MapView
+
+public MapView (Context context,
+ String apiKey)
+
+
+Parameters: context - apiKey -
+
+
+
+
+MapView
+
+public MapView (Context context,
+ AttributeSet attrs)
+
+
+Parameters: context - attrs -
+
+
+
+
+MapView
+
+public MapView (Context context,
+ AttributeSet attrs,
+ int defStyle)
+
+
+Parameters: context - attrs - defStyle -
+
+
+
+
+
+
+
+
+onInterceptTouchEvent
+
+public boolean onInterceptTouchEvent (MotionEvent ev)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/MidPoint.html b/LocationLib/doc/com/TwentyCodes/android/location/MidPoint.html
new file mode 100644
index 0000000..3d1cb66
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/MidPoint.html
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+MidPoint
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class MidPoint
+
+java.lang.Object
+ com.TwentyCodes.android.location.MidPoint
+
+
+
+public class MidPoint extends Object
+
+
+
+This MidPoint object will hold the information form the calculations performed by GeoUtils.midPoint().
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+MidPoint (GeoPoint midPoint,
+ int minLatitude,
+ int minLongitude,
+ int maxLatitude,
+ int maxLongitude)
+
+
+ Creates a new MidPoint
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ GeoPoint
+getMidPoint ()
+
+
+ returns the calculated midpoint
+
+
+
+ void
+zoomToSpan (com.google.android.maps.MapView mMapView)
+
+
+ zooms the provided map view to the span of this mid point
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+MidPoint
+
+public MidPoint (GeoPoint midPoint,
+ int minLatitude,
+ int minLongitude,
+ int maxLatitude,
+ int maxLongitude)
+
+Creates a new MidPoint
+
+
+
+
+
+
+
+
+
+zoomToSpan
+
+public void zoomToSpan (com.google.android.maps.MapView mMapView)
+
+zooms the provided map view to the span of this mid point
+
+
+Parameters: mMapView -
+
+
+
+
+
+getMidPoint
+
+public GeoPoint getMidPoint ()
+
+returns the calculated midpoint
+
+
+
+Returns:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/Receiver.html b/LocationLib/doc/com/TwentyCodes/android/location/Receiver.html
new file mode 100644
index 0000000..24571db
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/Receiver.html
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+Class Receiver
+
+java.lang.Object
+ BroadcastReceiver
+ com.TwentyCodes.android.location.Receiver
+
+
+
+public class Receiver extends BroadcastReceiver
+
+
+
+this class will be used to start the either the skyhook service or location service via android's alarm manager
+
+
+
+
+Author:
+ ricky barrette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Receiver ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ void
+onReceive (Context context,
+ Intent intent)
+
+
+ (non-Javadoc)
+
+
+
+
+
+
+
+
+
+
+
+
+
+KEY_REQEST_CODE
+
+public static final String KEY_REQEST_CODE
+
+
+See Also: Constant Field Values
+
+
+
+
+ANDROID_SERVICE_REQUEST_CODE
+
+public static final int ANDROID_SERVICE_REQUEST_CODE
+
+
+See Also: Constant Field Values
+
+
+
+
+SKYHOOK_SERVICE_REQUEST_CODE
+
+public static final int SKYHOOK_SERVICE_REQUEST_CODE
+
+
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Receiver
+
+public Receiver ()
+
+
+
+
+
+
+
+
+
+onReceive
+
+public void onReceive (Context context,
+ Intent intent)
+
+(non-Javadoc)
+
+
+Parameters: context - intent - See Also: BroadcastReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/GeoUtils.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/GeoUtils.html
new file mode 100644
index 0000000..f8589a9
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/GeoUtils.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.GeoUtils
+
+No usage of com.TwentyCodes.android.location.GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationReceiver.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationReceiver.html
new file mode 100644
index 0000000..99c8510
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationReceiver.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.LocationReceiver
+
+No usage of com.TwentyCodes.android.location.LocationReceiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationService.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationService.html
new file mode 100644
index 0000000..b4e19e0
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/LocationService.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.LocationService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.LocationService
+
+No usage of com.TwentyCodes.android.location.LocationService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/MapView.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/MapView.html
new file mode 100644
index 0000000..240b551
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/MapView.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.MapView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.MapView
+
+No usage of com.TwentyCodes.android.location.MapView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/MidPoint.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/MidPoint.html
new file mode 100644
index 0000000..ed7aec7
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/MidPoint.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.MidPoint
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.MidPoint
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/class-use/Receiver.html b/LocationLib/doc/com/TwentyCodes/android/location/class-use/Receiver.html
new file mode 100644
index 0000000..59eba64
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/class-use/Receiver.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class com.TwentyCodes.android.location.Receiver
+
+No usage of com.TwentyCodes.android.location.Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/package-frame.html b/LocationLib/doc/com/TwentyCodes/android/location/package-frame.html
new file mode 100644
index 0000000..d8754da
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/package-frame.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/package-summary.html b/LocationLib/doc/com/TwentyCodes/android/location/package-summary.html
new file mode 100644
index 0000000..acc5baa
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/package-summary.html
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+com.TwentyCodes.android.location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Package com.TwentyCodes.android.location
+
+
+
+
+
+Class Summary
+
+
+GeoUtils
+This class contains common tools for computing common geological problems
+
+
+LocationReceiver
+this abstract class will be used as a template for classes wishing to receiver location updates from the skyhook location service
+
+
+LocationService
+this service class will be used broadcast the users location periodic
+
+
+MapView
+We use this MapView Because it has double tap zoom capability
+
+
+MidPoint
+This MidPoint object will hold the information form the calculations performed by GeoUtils.midPoint().
+
+
+Receiver
+this class will be used to start the either the skyhook service or location service via android's alarm manager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/package-tree.html b/LocationLib/doc/com/TwentyCodes/android/location/package-tree.html
new file mode 100644
index 0000000..6ba3242
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/package-tree.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+com.TwentyCodes.android.location Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For Package com.TwentyCodes.android.location
+
+
+
+Package Hierarchies: All Packages
+
+
+Class Hierarchy
+
+
+java.lang.Object
+BroadcastReceiver
+ BroadcastReceiver
+com.TwentyCodes.android.location.Receiver
+ com.TwentyCodes.android.location.GeoUtils com.google.android.maps.MapView
+com.TwentyCodes.android.location.MapView
+ com.TwentyCodes.android.location.MidPoint Service
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/com/TwentyCodes/android/location/package-use.html b/LocationLib/doc/com/TwentyCodes/android/location/package-use.html
new file mode 100644
index 0000000..e7651bb
--- /dev/null
+++ b/LocationLib/doc/com/TwentyCodes/android/location/package-use.html
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+Uses of Package com.TwentyCodes.android.location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Package com.TwentyCodes.android.location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/constant-values.html b/LocationLib/doc/constant-values.html
new file mode 100644
index 0000000..f26c820
--- /dev/null
+++ b/LocationLib/doc/constant-values.html
@@ -0,0 +1,456 @@
+
+
+
+
+
+
+Constant Field Values
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constant Field Values
+
+
+Contents
+
+
+
+
+
+com.TwentyCodes.*
+
+
+
+
+
+
+
+com.TwentyCodes.android.location.GeoUtils
+
+
+
+public static final int
+EARTH_RADIUS_KM
+6371
+
+
+
+public static final double
+MILLION
+1000000.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook.R.id
+
+
+
+public static final int
+skyhook_img
+2131034112
+
+
+
+public static final int
+tc_img
+2131034114
+
+
+
+public static final int
+text
+2131034113
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+com.TwentyCodes.android.SkyHook.R.string
+
+
+
+public static final int
+app_name
+2130968577
+
+
+
+public static final int
+hello
+2130968576
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/deprecated-list.html b/LocationLib/doc/deprecated-list.html
new file mode 100644
index 0000000..65f29c1
--- /dev/null
+++ b/LocationLib/doc/deprecated-list.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+Deprecated List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Deprecated API
+
+
+Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/help-doc.html b/LocationLib/doc/help-doc.html
new file mode 100644
index 0000000..f3b701c
--- /dev/null
+++ b/LocationLib/doc/help-doc.html
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+API Help
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+How This API Document Is Organized
+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+Overview
+
+
+
+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+
+Package
+
+
+
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
+Interfaces (italic) Classes Enums Exceptions Errors Annotation Types
+
+
+Class/Interface
+
+
+
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Class inheritance diagram Direct Subclasses All Known Subinterfaces All Known Implementing Classes Class/interface declaration Class/interface description
+
+
Nested Class Summary Field Summary Constructor Summary Method Summary
+
+
Field Detail Constructor Detail Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+
+
+Annotation Type
+
+
+
+Each annotation type has its own separate page with the following sections:
+Annotation Type declaration Annotation Type description Required Element Summary Optional Element Summary Element Detail
+
+
+
+Enum
+
+
+
+Each enum has its own separate page with the following sections:
+Enum declaration Enum description Enum Constant Summary Enum Constant Detail
+
+
+Use
+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+
+Tree (Class Hierarchy)
+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
+When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+Deprecated API
+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+Index
+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+
+Prev/Next
+These links take you to the next or previous class, interface, package, or related page.
+Frames/No Frames
+These links show and hide the HTML frames. All pages are available with or without frames.
+
+
+Serialized Form
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+
+
+Constant Field Values
+The Constant Field Values page lists the static final fields and their values.
+
+
+
+This help file applies to API documentation generated using the standard doclet.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/index-files/index-1.html b/LocationLib/doc/index-files/index-1.html
new file mode 100644
index 0000000..1b307de
--- /dev/null
+++ b/LocationLib/doc/index-files/index-1.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+A-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+A
+
+ACTION_UPDATE -
+Static variable in class com.TwentyCodes.android.location.LocationReceiver
+
+ ANDROID_SERVICE_REQUEST_CODE -
+Static variable in class com.TwentyCodes.android.location.Receiver
+
+ app_name -
+Static variable in class com.TwentyCodes.android.SkyHook.R.string
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-10.html b/LocationLib/doc/index-files/index-10.html
new file mode 100644
index 0000000..a9a0273
--- /dev/null
+++ b/LocationLib/doc/index-files/index-10.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+K-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+K
+
+KEY_REQEST_CODE -
+Static variable in class com.TwentyCodes.android.location.Receiver
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-11.html b/LocationLib/doc/index-files/index-11.html
new file mode 100644
index 0000000..a3ee1cd
--- /dev/null
+++ b/LocationLib/doc/index-files/index-11.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+L-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+L
+
+LOCATION_MESSAGE -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+ LOCATION_PARCEL -
+Static variable in class com.TwentyCodes.android.location.LocationReceiver
+
+ LocationReceiver - Class in com.TwentyCodes.android.location this abstract class will be used as a template for classes wishing to receiver location updates from the skyhook location service LocationReceiver() -
+Constructor for class com.TwentyCodes.android.location.LocationReceiver
+
+ LocationService - Class in com.TwentyCodes.android.location this service class will be used broadcast the users location periodic LocationService() -
+Constructor for class com.TwentyCodes.android.location.LocationService
+
+ logoidea3 -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-12.html b/LocationLib/doc/index-files/index-12.html
new file mode 100644
index 0000000..2655cad
--- /dev/null
+++ b/LocationLib/doc/index-files/index-12.html
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+M-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+M
+
+MapView - Class in com.TwentyCodes.android.location We use this MapView Because it has double tap zoom capability MapView(Context, String) -
+Constructor for class com.TwentyCodes.android.location.MapView
+
+ MapView(Context, AttributeSet) -
+Constructor for class com.TwentyCodes.android.location.MapView
+
+ MapView(Context, AttributeSet, int) -
+Constructor for class com.TwentyCodes.android.location.MapView
+
+ mContext -
+Variable in class com.TwentyCodes.android.location.LocationReceiver
+
+ midPoint(GeoPoint, GeoPoint) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+computes a geopoint the is the central geopoint between p1 and p1
+ MidPoint - Class in com.TwentyCodes.android.location This MidPoint object will hold the information form the calculations performed by GeoUtils.midPoint(). MidPoint(GeoPoint, int, int, int, int) -
+Constructor for class com.TwentyCodes.android.location.MidPoint
+Creates a new MidPoint
+ MILLION -
+Static variable in class com.TwentyCodes.android.location.GeoUtils
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-13.html b/LocationLib/doc/index-files/index-13.html
new file mode 100644
index 0000000..95749cb
--- /dev/null
+++ b/LocationLib/doc/index-files/index-13.html
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+O-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+O
+
+onAccuracyChanged(Sensor, int) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Called when the accuracy of a sensor has changed.
+ onBind(Intent) -
+Method in class com.TwentyCodes.android.location.LocationService
+(non-Javadoc)
+ onBind(Intent) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+(non-Javadoc)
+ onCreate() -
+Method in class com.TwentyCodes.android.location.LocationService
+called when the service is created.
+ onCreate() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+
+ onCreate(Bundle) -
+Method in class com.TwentyCodes.android.SkyHook.Splash
+
+ onDestroy() -
+Method in class com.TwentyCodes.android.location.LocationService
+called when the service is destroyed.
+ onDestroy() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+aborts location services
+ (non-Javadoc)
+ onInterceptTouchEvent(MotionEvent) -
+Method in class com.TwentyCodes.android.location.MapView
+
+ onLocationChanged(Location) -
+Method in class com.TwentyCodes.android.location.LocationService
+(non-Javadoc)
+ onLocationUpdate(Location) -
+Method in class com.TwentyCodes.android.location.LocationReceiver
+called when a location update is received
+ onProviderDisabled(String) -
+Method in class com.TwentyCodes.android.location.LocationService
+(non-Javadoc)
+ onProviderEnabled(String) -
+Method in class com.TwentyCodes.android.location.LocationService
+(non-Javadoc)
+ onReceive(Context, Intent) -
+Method in class com.TwentyCodes.android.location.LocationReceiver
+(non-Javadoc)
+ onReceive(Context, Intent) -
+Method in class com.TwentyCodes.android.location.Receiver
+(non-Javadoc)
+ onSensorChanged(SensorEvent) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Called when sensor values have changed.
+ onStart(Intent, int) -
+Method in class com.TwentyCodes.android.location.LocationService
+To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+ onStart(Intent, int) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+ onStartCommand(Intent, int, int) -
+Method in class com.TwentyCodes.android.location.LocationService
+This method is called when startService is called.
+ onStartCommand(Intent, int, int) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+This method is called when startService is called.
+ onStatusChanged(String, int, Bundle) -
+Method in class com.TwentyCodes.android.location.LocationService
+(non-Javadoc)
+ onXPSLocationChanged(GeoPoint, int) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle.
+ onXPSLocationChanged(GeoPoint, int) -
+Method in interface com.TwentyCodes.android.SkyHook.XPSLocationListener
+Called when the location has changed
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-14.html b/LocationLib/doc/index-files/index-14.html
new file mode 100644
index 0000000..6e5bdef
--- /dev/null
+++ b/LocationLib/doc/index-files/index-14.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+P-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+P
+
+PERIOD_BETWEEN_UPDATES -
+Static variable in class com.TwentyCodes.android.location.LocationService
+
+ PERIOD_BETWEEN_UPDATES -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHookService
+
+ powered_by_skyhook -
+Static variable in class com.TwentyCodes.android.SkyHook.R.layout
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-15.html b/LocationLib/doc/index-files/index-15.html
new file mode 100644
index 0000000..8c12e96
--- /dev/null
+++ b/LocationLib/doc/index-files/index-15.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+R-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+R
+
+R - Class in com.TwentyCodes.android.SkyHook R() -
+Constructor for class com.TwentyCodes.android.SkyHook.R
+
+ R.attr - Class in com.TwentyCodes.android.SkyHook R.attr() -
+Constructor for class com.TwentyCodes.android.SkyHook.R.attr
+
+ R.drawable - Class in com.TwentyCodes.android.SkyHook R.drawable() -
+Constructor for class com.TwentyCodes.android.SkyHook.R.drawable
+
+ R.id - Class in com.TwentyCodes.android.SkyHook R.id() -
+Constructor for class com.TwentyCodes.android.SkyHook.R.id
+
+ R.layout - Class in com.TwentyCodes.android.SkyHook R.layout() -
+Constructor for class com.TwentyCodes.android.SkyHook.R.layout
+
+ R.string - Class in com.TwentyCodes.android.SkyHook R.string() -
+Constructor for class com.TwentyCodes.android.SkyHook.R.string
+
+ radToBearing(double) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+converts radians to bearing
+ REALM -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+ Receiver - Class in com.TwentyCodes.android.location this class will be used to start the either the skyhook service or location service via android's alarm manager Receiver() -
+Constructor for class com.TwentyCodes.android.location.Receiver
+
+ registerListener(XPSLocationListener) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Attempts to register the listener for location updates
+ registerNewUser(RegistrationCallback) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookRegistration
+attempts to register the user by their cell #
+
+ TODO hash cell number for privacy
+ removeUpdates() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHook
+Removes any current registration for location updates of the current activity
+ with the given LocationListener.
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-16.html b/LocationLib/doc/index-files/index-16.html
new file mode 100644
index 0000000..88e5d24
--- /dev/null
+++ b/LocationLib/doc/index-files/index-16.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+S-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+S
+
+setLocationListener(XPSLocationListener) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHook
+Used for receiving notifications from SkyHook when
+ the location has changed.
+ showSpashScreen(Context) -
+Static method in class com.TwentyCodes.android.SkyHook.Splash
+a convince method for starting the splash screen activity
+ SkyHook - Class in com.TwentyCodes.android.SkyHook this calls will be used to create skyhook object that uses an listener interface to interact with the rest of location ringer SkyHook(Context) -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHook
+Constructors a new skyhook object
+ SkyHook(Context, long) -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHook
+Constructors a new skyhook object
+ skyhook_img -
+Static variable in class com.TwentyCodes.android.SkyHook.R.id
+
+ skyhook_logo -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+ skyhook_logo_alpha -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+ skyhook_logo_alpha_small -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+ SKYHOOK_SERVICE_REQUEST_CODE -
+Static variable in class com.TwentyCodes.android.location.Receiver
+
+ SkyHookRegistration - Class in com.TwentyCodes.android.SkyHook this class will be used to register new users with skyhook SkyHookRegistration(Context) -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+ SkyHookService - Class in com.TwentyCodes.android.SkyHook this will be a service that will retrieve periodic updates on the users location SkyHookService() -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHookService
+
+ SkyHookUserOverlay - Class in com.TwentyCodes.android.SkyHook this class will be used to the users location on the map using skyhook's call back methods SkyHookUserOverlay(MapView, Context) -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Construct a new SkyHookUserOverlaymFollowUser
+ SkyHookUserOverlay(MapView, Context, boolean) -
+Constructor for class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Construct a new SkyHookUserOverlay
+ Splash - Class in com.TwentyCodes.android.SkyHook this activity will be used to display the Twenty Codes, LLC and Skyhook Wireless Splash Screen Splash() -
+Constructor for class com.TwentyCodes.android.SkyHook.Splash
+
+ startService(Context, long) -
+Static method in class com.TwentyCodes.android.location.LocationService
+a convince method for starting the service.
+ startService(Context, long) -
+Static method in class com.TwentyCodes.android.SkyHook.SkyHookService
+a convince method for starting the service.
+ stopService(Context) -
+Static method in class com.TwentyCodes.android.location.LocationService
+a convince method for stopping the service
+ stopService(Context) -
+Static method in class com.TwentyCodes.android.SkyHook.SkyHookService
+a convince method for stopping the service
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-17.html b/LocationLib/doc/index-files/index-17.html
new file mode 100644
index 0000000..126a1a6
--- /dev/null
+++ b/LocationLib/doc/index-files/index-17.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+T-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+T
+
+TAG -
+Static variable in class com.TwentyCodes.android.location.LocationService
+
+ TAG -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+ TAG -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHookService
+
+ tc_img -
+Static variable in class com.TwentyCodes.android.SkyHook.R.id
+
+ tc_logo_complete -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+ text -
+Static variable in class com.TwentyCodes.android.SkyHook.R.id
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-18.html b/LocationLib/doc/index-files/index-18.html
new file mode 100644
index 0000000..5e282d9
--- /dev/null
+++ b/LocationLib/doc/index-files/index-18.html
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+U-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+U
+
+unRegisterListener() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+UnResgisters the listener.
+ user -
+Static variable in class com.TwentyCodes.android.SkyHook.R.drawable
+
+ USERNAME -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+ USERNAME_FOR_TESTING -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-19.html b/LocationLib/doc/index-files/index-19.html
new file mode 100644
index 0000000..3468ae0
--- /dev/null
+++ b/LocationLib/doc/index-files/index-19.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+X-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+X
+
+XPSLocationListener - Interface in com.TwentyCodes.android.SkyHook this interface will be used to interface with skyhook sdk with the rest of the application
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-2.html b/LocationLib/doc/index-files/index-2.html
new file mode 100644
index 0000000..b21c043
--- /dev/null
+++ b/LocationLib/doc/index-files/index-2.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+B-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+B
+
+bearing(double, double, double, double) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+ bearing(GeoPoint, GeoPoint) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-20.html b/LocationLib/doc/index-files/index-20.html
new file mode 100644
index 0000000..4505306
--- /dev/null
+++ b/LocationLib/doc/index-files/index-20.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+Z-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+Z
+
+zoomToSpan(com.google.android.maps.MapView) -
+Method in class com.TwentyCodes.android.location.MidPoint
+zooms the provided map view to the span of this mid point
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-3.html b/LocationLib/doc/index-files/index-3.html
new file mode 100644
index 0000000..ae7a202
--- /dev/null
+++ b/LocationLib/doc/index-files/index-3.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+C-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+C
+
+com.TwentyCodes.android.location - package com.TwentyCodes.android.location com.TwentyCodes.android.SkyHook - package com.TwentyCodes.android.SkyHook convertLocation() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookService
+converts skyhook's location object into android's location object
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-4.html b/LocationLib/doc/index-files/index-4.html
new file mode 100644
index 0000000..ace9b73
--- /dev/null
+++ b/LocationLib/doc/index-files/index-4.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+D-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+D
+
+disableMyLocation() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Stops location updates and removes the overlay from view
+ distanceFrom(GeoPoint, double) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+Calculates a geopoint x meters away of the geopoint supplied.
+ distanceKm(double, double, double, double) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+ distanceKm(GeoPoint, GeoPoint) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+computes the distance between to p1 and p2 based on the curve of the earth
+ DONE_MESSAGE -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+ draw(Canvas, MapView, boolean) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+we override this methods so we can provide a drawable and a location to draw on the canvas.
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-5.html b/LocationLib/doc/index-files/index-5.html
new file mode 100644
index 0000000..59b7d66
--- /dev/null
+++ b/LocationLib/doc/index-files/index-5.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+E-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+E
+
+EARTH_RADIUS_KM -
+Static variable in class com.TwentyCodes.android.location.GeoUtils
+
+ enableMyLocation() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Attempts to enable MyLocation, registering for updates from sky hook
+ ERROR_MESSAGE -
+Static variable in class com.TwentyCodes.android.SkyHook.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-6.html b/LocationLib/doc/index-files/index-6.html
new file mode 100644
index 0000000..505b093
--- /dev/null
+++ b/LocationLib/doc/index-files/index-6.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+F-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+F
+
+followUser(boolean) -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+Allows the map to follow the user
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-7.html b/LocationLib/doc/index-files/index-7.html
new file mode 100644
index 0000000..e84688e
--- /dev/null
+++ b/LocationLib/doc/index-files/index-7.html
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+G-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+G
+
+GeoUtils - Class in com.TwentyCodes.android.location This class contains common tools for computing common geological problems GeoUtils() -
+Constructor for class com.TwentyCodes.android.location.GeoUtils
+
+ getLoctaion() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHook
+request current user location, note that the listeners onLocationChanged() will be call multiple times.
+ getMidPoint() -
+Method in class com.TwentyCodes.android.location.MidPoint
+returns the calculated midpoint
+ getUpdates() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHook
+Attempts to register the the listener for periodic updates
+ getUserBearing() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+returns the users current bearing
+ getUserLocation() -
+Method in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+returns the users current location
+ getUserName(Context) -
+Static method in class com.TwentyCodes.android.SkyHook.SkyHookRegistration
+returns the users username
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-8.html b/LocationLib/doc/index-files/index-8.html
new file mode 100644
index 0000000..ac490f0
--- /dev/null
+++ b/LocationLib/doc/index-files/index-8.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+H-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+H
+
+hello -
+Static variable in class com.TwentyCodes.android.SkyHook.R.string
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index-files/index-9.html b/LocationLib/doc/index-files/index-9.html
new file mode 100644
index 0000000..6ebcd0d
--- /dev/null
+++ b/LocationLib/doc/index-files/index-9.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+I-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+I
+
+isFollowingUser -
+Variable in class com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
+
+ isIntersecting(GeoPoint, float, GeoPoint, float, float) -
+Static method in class com.TwentyCodes.android.location.GeoUtils
+a convince method for testing if 2 circles on the the surface of the earth intersect.
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I K L M O P R S T U X Z
+
+
+
diff --git a/LocationLib/doc/index.html b/LocationLib/doc/index.html
new file mode 100644
index 0000000..a1dec32
--- /dev/null
+++ b/LocationLib/doc/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+Generated Documentation (Untitled)
+
+
+
+
+
+
+
+
+
+
+
+
+
+Frame Alert
+
+
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+Link toNon-frame version.
+
+
+
diff --git a/LocationLib/doc/overview-frame.html b/LocationLib/doc/overview-frame.html
new file mode 100644
index 0000000..7eb0357
--- /dev/null
+++ b/LocationLib/doc/overview-frame.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+Overview List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/overview-summary.html b/LocationLib/doc/overview-summary.html
new file mode 100644
index 0000000..eb35415
--- /dev/null
+++ b/LocationLib/doc/overview-summary.html
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/overview-tree.html b/LocationLib/doc/overview-tree.html
new file mode 100644
index 0000000..755d868
--- /dev/null
+++ b/LocationLib/doc/overview-tree.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For All Packages
+
+
+Package Hierarchies: com.TwentyCodes.android.location , com.TwentyCodes.android.SkyHook
+
+
+Class Hierarchy
+
+
+java.lang.Object
+Activity
+com.TwentyCodes.android.SkyHook.Splash
+ BroadcastReceiver
+ BroadcastReceiver
+com.TwentyCodes.android.location.Receiver
+ com.TwentyCodes.android.location.GeoUtils com.google.android.maps.MapView
+com.TwentyCodes.android.location.MapView
+ com.TwentyCodes.android.location.MidPoint Overlay
+ com.TwentyCodes.android.SkyHook.R com.TwentyCodes.android.SkyHook.R.attr com.TwentyCodes.android.SkyHook.R.drawable com.TwentyCodes.android.SkyHook.R.id com.TwentyCodes.android.SkyHook.R.layout com.TwentyCodes.android.SkyHook.R.string Service
+ Service
+ com.TwentyCodes.android.SkyHook.SkyHook com.TwentyCodes.android.SkyHook.SkyHookRegistration
+
+
+Interface Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/package-list b/LocationLib/doc/package-list
new file mode 100644
index 0000000..663bee1
--- /dev/null
+++ b/LocationLib/doc/package-list
@@ -0,0 +1,2 @@
+com.TwentyCodes.android.SkyHook
+com.TwentyCodes.android.location
diff --git a/LocationLib/doc/resources/inherit.gif b/LocationLib/doc/resources/inherit.gif
new file mode 100644
index 0000000..c814867
Binary files /dev/null and b/LocationLib/doc/resources/inherit.gif differ
diff --git a/LocationLib/doc/serialized-form.html b/LocationLib/doc/serialized-form.html
new file mode 100644
index 0000000..d00e4bc
--- /dev/null
+++ b/LocationLib/doc/serialized-form.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+Serialized Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Serialized Form
+
+
+
+
+
+
+Package com.TwentyCodes.android.SkyHook
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/doc/stylesheet.css b/LocationLib/doc/stylesheet.css
new file mode 100644
index 0000000..6ea9e51
--- /dev/null
+++ b/LocationLib/doc/stylesheet.css
@@ -0,0 +1,29 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body { background-color: #FFFFFF; color:#000000 }
+
+/* Headings */
+h1 { font-size: 145% }
+
+/* Table colors */
+.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
+.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
+.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
+.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
+
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+
diff --git a/LocationLib/gen/com/TwentyCodes/android/SkyHook/R.java b/LocationLib/gen/com/TwentyCodes/android/SkyHook/R.java
new file mode 100644
index 0000000..8bc5ae4
--- /dev/null
+++ b/LocationLib/gen/com/TwentyCodes/android/SkyHook/R.java
@@ -0,0 +1,40 @@
+/* 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.TwentyCodes.android.SkyHook;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static int compass=0x7f020000;
+ public static int logoidea3=0x7f020001;
+ public static int needle=0x7f020002;
+ public static int skyhook_logo=0x7f020003;
+ public static int skyhook_logo_alpha=0x7f020004;
+ public static int skyhook_logo_alpha_small=0x7f020005;
+ public static int tc_logo_complete=0x7f020006;
+ public static int user=0x7f020007;
+ public static int user_arrow_animation_1=0x7f020008;
+ public static int user_arrow_animation_2=0x7f020009;
+ public static int user_arrow_animation_3=0x7f02000a;
+ public static int userarrow=0x7f02000b;
+ }
+ public static final class id {
+ public static int skyhook_img=0x7f050000;
+ public static int tc_img=0x7f050002;
+ public static int text=0x7f050001;
+ }
+ public static final class layout {
+ public static int powered_by_skyhook=0x7f030000;
+ }
+ public static final class string {
+ public static int app_name=0x7f040000;
+ public static int gps_fix=0x7f040001;
+ public static int sorry_theres_trouble=0x7f040002;
+ }
+}
diff --git a/LocationLib/javadoc.xml b/LocationLib/javadoc.xml
new file mode 100644
index 0000000..711d3a0
--- /dev/null
+++ b/LocationLib/javadoc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/LocationLib/lib/skyhook_version.txt b/LocationLib/lib/skyhook_version.txt
new file mode 100644
index 0000000..737f09b
--- /dev/null
+++ b/LocationLib/lib/skyhook_version.txt
@@ -0,0 +1 @@
+4.2.0_14
\ No newline at end of file
diff --git a/LocationLib/lib/wpsapi.jar b/LocationLib/lib/wpsapi.jar
new file mode 100644
index 0000000..d7e8cc5
Binary files /dev/null and b/LocationLib/lib/wpsapi.jar differ
diff --git a/LocationLib/project.properties b/LocationLib/project.properties
new file mode 100644
index 0000000..2a842ee
--- /dev/null
+++ b/LocationLib/project.properties
@@ -0,0 +1,12 @@
+# 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.
+
+android.library=true
+# Project target.
+target=Google Inc.:Google APIs:14
diff --git a/LocationLib/res/drawable/compass.png b/LocationLib/res/drawable/compass.png
new file mode 100644
index 0000000..c20fada
Binary files /dev/null and b/LocationLib/res/drawable/compass.png differ
diff --git a/LocationLib/res/drawable/logoidea3.png b/LocationLib/res/drawable/logoidea3.png
new file mode 100644
index 0000000..75e51b6
Binary files /dev/null and b/LocationLib/res/drawable/logoidea3.png differ
diff --git a/LocationLib/res/drawable/needle.png b/LocationLib/res/drawable/needle.png
new file mode 100644
index 0000000..3e77bc0
Binary files /dev/null and b/LocationLib/res/drawable/needle.png differ
diff --git a/LocationLib/res/drawable/skyhook_logo.jpg b/LocationLib/res/drawable/skyhook_logo.jpg
new file mode 100644
index 0000000..6e877e1
Binary files /dev/null and b/LocationLib/res/drawable/skyhook_logo.jpg differ
diff --git a/LocationLib/res/drawable/skyhook_logo_alpha.png b/LocationLib/res/drawable/skyhook_logo_alpha.png
new file mode 100644
index 0000000..417e5d1
Binary files /dev/null and b/LocationLib/res/drawable/skyhook_logo_alpha.png differ
diff --git a/LocationLib/res/drawable/skyhook_logo_alpha_small.png b/LocationLib/res/drawable/skyhook_logo_alpha_small.png
new file mode 100644
index 0000000..cea2154
Binary files /dev/null and b/LocationLib/res/drawable/skyhook_logo_alpha_small.png differ
diff --git a/LocationLib/res/drawable/tc_logo_complete.png b/LocationLib/res/drawable/tc_logo_complete.png
new file mode 100644
index 0000000..231f42e
Binary files /dev/null and b/LocationLib/res/drawable/tc_logo_complete.png differ
diff --git a/LocationLib/res/drawable/user.png b/LocationLib/res/drawable/user.png
new file mode 100644
index 0000000..3fbc6e4
Binary files /dev/null and b/LocationLib/res/drawable/user.png differ
diff --git a/LocationLib/res/drawable/user_arrow_animation_1.png b/LocationLib/res/drawable/user_arrow_animation_1.png
new file mode 100644
index 0000000..37057f8
Binary files /dev/null and b/LocationLib/res/drawable/user_arrow_animation_1.png differ
diff --git a/LocationLib/res/drawable/user_arrow_animation_2.png b/LocationLib/res/drawable/user_arrow_animation_2.png
new file mode 100644
index 0000000..a3439b9
Binary files /dev/null and b/LocationLib/res/drawable/user_arrow_animation_2.png differ
diff --git a/LocationLib/res/drawable/user_arrow_animation_3.png b/LocationLib/res/drawable/user_arrow_animation_3.png
new file mode 100644
index 0000000..4ecd56e
Binary files /dev/null and b/LocationLib/res/drawable/user_arrow_animation_3.png differ
diff --git a/LocationLib/res/drawable/userarrow.xml b/LocationLib/res/drawable/userarrow.xml
new file mode 100644
index 0000000..6b7045e
--- /dev/null
+++ b/LocationLib/res/drawable/userarrow.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LocationLib/res/layout/powered_by_skyhook.xml b/LocationLib/res/layout/powered_by_skyhook.xml
new file mode 100644
index 0000000..216e9aa
--- /dev/null
+++ b/LocationLib/res/layout/powered_by_skyhook.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LocationLib/res/values/strings.xml b/LocationLib/res/values/strings.xml
new file mode 100644
index 0000000..5dc31fc
--- /dev/null
+++ b/LocationLib/res/values/strings.xml
@@ -0,0 +1,6 @@
+
+
+ SkyHookLib
+ GPS Fix
+ We are having issues finding your location. Please be patient as we continue to try in the background.
+
diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHook.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHook.java
new file mode 100644
index 0000000..45b7629
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHook.java
@@ -0,0 +1,292 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 2, 2010
+ */
+package com.TwentyCodes.android.SkyHook;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+import com.TwentyCodes.android.location.AndroidGPS;
+import com.TwentyCodes.android.location.GeoPointLocationListener;
+import com.google.android.maps.GeoPoint;
+import com.skyhookwireless.wps.WPSAuthentication;
+import com.skyhookwireless.wps.WPSContinuation;
+import com.skyhookwireless.wps.WPSLocation;
+import com.skyhookwireless.wps.WPSPeriodicLocationCallback;
+import com.skyhookwireless.wps.WPSReturnCode;
+import com.skyhookwireless.wps.XPS;
+
+/**
+ * this calls will be used to create skyhook object that uses an listener interface to interact with the rest of location ringer
+ * @author ricky barrette
+ */
+public class SkyHook implements GeoPointLocationListener{
+
+ public static final String TAG = "Skyhook";
+ public static final String USERNAME = "cjyh95q32gsc";
+ public static final String USERNAME_FOR_TESTING = "twentycodes";
+ public static final String REALM = "TwentyCodes";
+ public static final int LOCATION_MESSAGE = 1;
+ public static final int ERROR_MESSAGE = 2;
+ public static final int DONE_MESSAGE = 3;
+ private GeoPointLocationListener mListener;
+ private long mPeriod = 0l; //period is in milliseconds for periodic updates
+ private int mIterations = 0;
+ private XPS mXps;
+ private WPSAuthentication mWPSAuthentication;
+ private Handler mHandler;
+ private final XPScallback mXPScallback = new XPScallback();
+ private boolean isPeriodicEnabled;
+ private Context mContext;
+ private boolean hasLocation;
+ protected AndroidGPS mSkyHookFallback = null;
+ protected long mFallBackDelay = 5000l;
+ private boolean isFallBackScheduled = false;
+ private boolean isEnabled = false;
+ private boolean isUnauthorized = false;
+
+ /*
+ * this runnable will be used to check if we have location from skyhook,
+ * if we dont, then we will us android's location services to fall back on.
+ */
+ private final Runnable mFallBack = new Runnable() {
+ public void run() {
+ mHandler.removeCallbacks(mFallBack);
+ Log.d(TAG,"skyhook, "+ (hasLocation ? "is" : "isn't") +" working!");
+
+ if((! hasLocation) && (mSkyHookFallback == null) && isEnabled){
+ Log.d(TAG,"falling back on android");
+ mSkyHookFallback = new AndroidGPS(mContext);
+ mSkyHookFallback.enableLocationUpdates(SkyHook.this);
+ /*
+ * Schedule another check, if skyhook is still enabled
+ */
+ if(mXps != null)
+ mHandler.postDelayed(mFallBack, mFallBackDelay );
+
+ } else {
+ Log.d(TAG,"already fell back on android");
+ if(mSkyHookFallback != null) {
+ Log.d(TAG,"got location, picking up the slack");
+ mSkyHookFallback.disableLocationUpdates();
+ mSkyHookFallback = null;
+ }
+ isFallBackScheduled = false;
+ }
+ }
+ };
+
+ /*
+ * this runnable keeps skyhook working!
+ */
+ private final Runnable mPeriodicUpdates = new Runnable() {
+ public void run() {
+ if(Debug.DEBUG)
+ Log.d(TAG,"geting location");
+ mXps.getXPSLocation(mWPSAuthentication, mIterations, XPS.EXACT_ACCURACY, mXPScallback);
+ }
+ };
+
+ private class XPScallback implements WPSPeriodicLocationCallback {
+ @Override
+ public void done() {
+ mHandler.sendMessage(mHandler.obtainMessage(DONE_MESSAGE));
+ }
+
+ @Override
+ public WPSContinuation handleError(WPSReturnCode error) {
+ mHandler.sendMessage(mHandler.obtainMessage(ERROR_MESSAGE, error));
+ return WPSContinuation.WPS_CONTINUE;
+ }
+
+ @Override
+ public WPSContinuation handleWPSPeriodicLocation(WPSLocation location) {
+ mHandler.sendMessage(mHandler.obtainMessage(LOCATION_MESSAGE, location));
+ return WPSContinuation.WPS_CONTINUE;
+ }
+ }
+
+ /**
+ * Constructors a new skyhook object
+ * @param context
+ * @author ricky barrette
+ */
+ public SkyHook(Context context) {
+ mXps = new XPS(context);
+ mContext = context;
+ // initialize the Handler which will display location data
+ // in the text view. we use a Handler because UI updates
+ // must occur in the UI thread
+ setUIHandler();
+ }
+
+ /**
+ * Constructors a new skyhook object
+ * @param context
+ * @param period between location updates in milliseconds
+ * @author ricky barrette
+ */
+ public SkyHook(Context context, long period) {
+ this(context);
+ mPeriod = period;
+ }
+
+ /**
+ * request current user location, note that the listeners onLocationChanged() will be call multiple times.
+ * updates will stop once an accurate location is determined.
+ * @author Ricky Barrette
+ */
+ public void getLoctaion(){
+ Log.d(TAG,"getLocation()");
+ if (mListener != null){
+ mWPSAuthentication = new WPSAuthentication(SkyHookRegistration.getUserName(mContext), REALM);
+ mHandler.post(mPeriodicUpdates);
+ }
+ }
+
+ /**
+ * Attempts to register the the listener for periodic updates
+ * @author Ricky Barrette
+ */
+ public void getUpdates(){
+ Log.d(TAG,"getUpdates()");
+ if (mListener != null) {
+
+ if(Debug.DEBUG)
+ Log.i(TAG, "username: " + SkyHookRegistration.getUserName(mContext));
+
+ mWPSAuthentication = new WPSAuthentication(SkyHookRegistration.getUserName(mContext), REALM);
+ isPeriodicEnabled = true;
+ mHandler.post(mPeriodicUpdates);
+ isEnabled = true;
+ }
+ }
+
+ /**
+ * @return true is skyhook is enabled
+ * @author ricky barrette
+ */
+ public boolean isEnabled(){
+ return isEnabled;
+ }
+
+ /**
+ * Removes any current registration for location updates of the current activity
+ * with the given LocationListener. Following this call, updates will no longer
+ * occur for this listener.
+ * @param listener
+ * @author ricky barrette
+ */
+ public void removeUpdates() {
+ Log.d(TAG,"removeUpdates()");
+ mHandler.removeCallbacks(mFallBack);
+ mListener = null;
+ isPeriodicEnabled = false;
+ if(mXps != null)
+ mXps.abort();
+ if(mSkyHookFallback != null) {
+ Log.d(TAG,"disabling fallback");
+ mSkyHookFallback.disableLocationUpdates();
+ mSkyHookFallback = null;
+ isEnabled = false;
+ }
+ }
+
+ /**
+ * Used for receiving notifications from SkyHook when
+ * the location has changed. These methods are called if the
+ * LocationListener has been registered with the location manager service using the method.
+ * @param listener
+ * @author ricky barrette
+ */
+ public void setLocationListener(GeoPointLocationListener listener){
+ Log.d(TAG,"setLocationListener()");
+ if (mListener == null) {
+ mListener = listener;
+ }
+ }
+
+ private void setUIHandler() {
+ mHandler = new Handler() {
+
+ @Override
+ public void handleMessage(final Message msg) {
+ switch (msg.what) {
+ case LOCATION_MESSAGE:
+ if (msg.obj instanceof WPSLocation) {
+ WPSLocation location = (WPSLocation) msg.obj;
+ if (mListener != null && location != null) {
+
+ if(Debug.DEBUG)
+ Log.d(TAG,"got location "+ location.getLatitude() +", "+ location.getLongitude()+" +- "+ location.getHPE() +"m");
+
+ mListener.onLocationChanged(new GeoPoint((int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)), location.getHPE());
+ hasLocation = true;
+ }
+ }
+ return;
+
+ case ERROR_MESSAGE:
+ if( msg.obj instanceof WPSReturnCode) {
+ WPSReturnCode code = (WPSReturnCode) msg.obj;
+ if ( code != null){
+ Log.w(TAG, code.toString());
+ }
+ hasLocation = false;
+
+ /*
+ * check to see if the error returned is an WPS_ERROR_UNAUTHORIZED
+ * then check to see if this is the second occurrence of WPS_ERROR_UNAUTHORIZED,
+ * if so we will stop skyhook's services to cut down the work load
+ */
+ if(code == WPSReturnCode.WPS_ERROR_UNAUTHORIZED){
+ if (isUnauthorized){
+ isPeriodicEnabled = false;
+ mXps.abort();
+ mXps = null;
+ }
+ isUnauthorized = true;
+ }
+
+
+ /*
+ * check to see if we already have a fall back Scheduled
+ * if we dont, and there is not fallback already in place, then schedule one
+ */
+ if((! isFallBackScheduled) && ( mSkyHookFallback == null) && isEnabled) {
+ Log.d(TAG, "scheduling fallback");
+ mHandler.postDelayed(mFallBack, mFallBackDelay);
+ isFallBackScheduled = true;
+ }
+ }
+ return;
+
+ case DONE_MESSAGE:
+ if (isPeriodicEnabled) {
+ mHandler.postDelayed(mPeriodicUpdates, mPeriod);
+ Log.d(TAG,"done getting location");
+ }
+ return;
+ }
+ }
+ };
+ }
+
+ /**
+ * called from our skyhook to android fall back class
+ * (non-Javadoc)
+ * @see com.TwentyCodes.android.location.GeoPointLocationListener#onLocationChanged(com.google.android.maps.GeoPoint, int)
+ * @author ricky barrette
+ */
+ @Override
+ public void onLocationChanged(GeoPoint point, int accuracy) {
+ if(! hasLocation)
+ if(mListener != null)
+ mListener.onLocationChanged(point, accuracy);
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookRegistration.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookRegistration.java
new file mode 100644
index 0000000..c3ca6fc
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookRegistration.java
@@ -0,0 +1,79 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 26, 2010
+ */
+package com.TwentyCodes.android.SkyHook;
+
+import android.content.Context;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+import com.skyhookwireless.wps.RegistrationCallback;
+import com.skyhookwireless.wps.WPSAuthentication;
+import com.skyhookwireless.wps.XPS;
+
+/**
+ * this class will be used to register new users with skyhook
+ * @author ricky barrette
+ */
+public class SkyHookRegistration{
+
+ private XPS mXps;
+ private Context mContext;
+
+ public SkyHookRegistration(Context context){
+ mContext = context;
+ mXps = new XPS(context);
+ }
+
+ /**
+ * attempts to register the user by their cell #
+ *
+ * TODO hash cell number for privacy
+ * @param listener for call back methods
+ * @author ricky barrette
+ */
+ public void registerNewUser(RegistrationCallback listener){
+ if(mXps != null){
+ TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ if(tm == null)
+ Log.v(SkyHook.TAG, "TelephonyManager is null");
+ String newUser = tm.getLine1Number();
+
+ if(Debug.DEBUG)
+ Log.v(SkyHook.TAG, "newUser = " + newUser);
+
+ if(newUser == null) {
+ Log.e(SkyHook.TAG,"users number is null");
+ }
+ mXps.registerUser(new WPSAuthentication(SkyHook.USERNAME, SkyHook.REALM), new WPSAuthentication(newUser, SkyHook.REALM), listener);
+ }
+ }
+
+ /**
+ * returns the users username
+ * @param context
+ * @return
+ * @author ricky barrette
+ */
+ public static String getUserName(Context context){
+
+ switch(Debug.DEFAULT_REGISTRATION_BEHAVIOR){
+ case NORMAL:
+ TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+ if(tm == null)
+ Log.v(SkyHook.TAG, "TelephonyManager is null");
+ return tm.getLine1Number();
+
+ case RETURN_NULL:
+ return null;
+
+ case USE_TESTING_USERNAME:
+ return SkyHook.USERNAME_FOR_TESTING;
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java
new file mode 100644
index 0000000..d1e45b0
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookService.java
@@ -0,0 +1,253 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author Ricky Barrette barrette
+ * @date Oct 6, 2010
+ */
+package com.TwentyCodes.android.SkyHook;
+
+import java.util.Calendar;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.location.Location;
+import android.os.Handler;
+import android.os.IBinder;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+import com.TwentyCodes.android.location.GeoPointLocationListener;
+import com.TwentyCodes.android.location.LocationReceiver;
+import com.google.android.maps.GeoPoint;
+import com.skyhookwireless.wps.RegistrationCallback;
+import com.skyhookwireless.wps.WPSContinuation;
+import com.skyhookwireless.wps.WPSReturnCode;
+
+/**
+ * This service class will be used broadcast the users location either one time, or periodically.
+ * To use as a one shot location service:
+ * PendingIntent pendingIntent = PendingIntent.getService(context, 0, SkyHookService.startService(context), 0);
+ * or
+ * Intent service = new Intent(context, SkyHookService.class);
+ * context.startService(service);
+ * To use as a recurring service:
+ * SkyHookService.startService(this, (60000 * Integer.parseInt(ringer.getString(UPDATE_INTVERVAL , "5")))).run();
+ * @author ricky barrette
+ */
+public class SkyHookService extends Service implements GeoPointLocationListener, RegistrationCallback{
+
+ /**
+ * Used to tell the service how frequently it needs to run. This is required if you want a multishot service
+ */
+ public static final String INTENT_EXTRA_PERIOD_BETWEEN_UPDATES = "period_beween_updates";
+
+ /**
+ * Used to tell the service how accurate of a location you want reported
+ */
+ public static final String INTENT_EXTRA_REQUIRED_ACCURACY = "required_accuracy";
+
+ /**
+ * Used to tell the service the update action to broadcast. If this is not supplied, {@link LocationReceiver.INTENT_EXTRA_ACTION_UPDATE } will be used.
+ * @see LocationReceiver.INTENT_EXTRA_ACTION_UPDATE
+ */
+ public static final String INTENT_EXTRA_ACTION_UPDATE = "action_update";
+
+ public static final String TAG = "SkyHookService";
+ public static final int REQUEST_CODE = 32741942;
+ private SkyHook mSkyhook;
+ protected long mPeriod = -1;
+ private GeoPoint mLocation;
+ private int mStartID;
+ private int mRequiredAccuracy;
+ private Intent mIntent;
+ private int mAccuracy;
+
+ /**
+ * broadcasts location to anything listening for updates
+ *
+ * @author ricky barrette
+ */
+ private void braodcastLocation() {
+ if (mLocation != null) {
+ Intent locationUpdate = new Intent();
+ if(mIntent.getAction() != null)
+ locationUpdate.setAction(mIntent.getAction());
+ else
+ locationUpdate.setAction(LocationReceiver.INTENT_EXTRA_ACTION_UPDATE);
+ locationUpdate.putExtra(LocationReceiver.INTENT_EXTRA_LOCATION_PARCEL, convertLocation());
+ sendBroadcast(locationUpdate);
+ }
+ }
+
+ /**
+ * converts skyhook's location object into android's location object
+ * @return converted location
+ * @author ricky barrette
+ */
+ public Location convertLocation(){
+ Location location = new Location("location");
+ location.setLatitude(this.mLocation.getLatitudeE6() /1e6);
+ location.setLongitude(this.mLocation.getLongitudeE6() /1e6);
+ location.setAccuracy(this.mAccuracy);
+ return location;
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.app.Service#onBind(android.content.Intent)
+ * @param arg0
+ * @return
+ * @author Ricky Barrette barrette
+ */
+ @Override
+ public IBinder onBind(Intent arg0) {
+ return null;
+ }
+
+ @Override
+ public void onCreate(){
+ super.onCreate();
+ this.mSkyhook = new SkyHook(this);
+ this.mSkyhook.setLocationListener(this);
+
+ /*
+ * fail safe
+ * this will stop the service after the maximum running time, if location has not been reported
+ */
+ new Handler().postDelayed(new Runnable(){
+ @Override
+ public void run(){
+ stopSelfResult(mStartID);
+ }
+ }, Debug.MAX_LOCATION_SERVICE_RUN_TIME);
+ }
+
+ /**
+ * aborts location services
+ * (non-Javadoc)
+ * @see android.app.Service#onDestroy()
+ * @author Ricky Barrette
+ */
+ @Override
+ public void onDestroy(){
+ mSkyhook.removeUpdates();
+ braodcastLocation();
+ //ask android to restart service if mPeriod is set
+ if(mPeriod > -1)
+ registerWakeUp();
+ super.onDestroy();
+ }
+
+ /*
+ * I believe that this method is no longer needed as we are not supporting pre 2.1
+ */
+// /**
+// * To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+// * @author ricky barrette
+// */
+// @Override
+// public void onStart(Intent intent, int startId) {
+// Log.i(SkyHook.TAG, "onStart.Service started with start id of: " + startId);
+// parseIntent(intent);
+// this.mSkyhook.getUpdates();
+// }
+
+ /**
+ * This method is called when startService is called. only used in 2.x android.
+ * @author ricky barrette
+ */
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ Log.i(SkyHook.TAG , "onStartCommand.Service started with start id of: " + startId);
+ mStartID = startId;
+ parseIntent(intent);
+ this.mSkyhook.getUpdates();
+ return START_STICKY;
+ }
+
+ /**
+ * Parses the incoming intent for the service options
+ *
+ * @author ricky barrette
+ */
+ private void parseIntent(Intent intent){
+
+ this.mIntent = intent;
+
+ if (intent.hasExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES))
+ mPeriod = intent.getLongExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, 60000L);
+
+ if (intent.hasExtra(INTENT_EXTRA_REQUIRED_ACCURACY))
+ mRequiredAccuracy = intent.getIntExtra(INTENT_EXTRA_REQUIRED_ACCURACY, -1);
+ }
+
+ /**
+ * registers our Receiver the starts the service with the alarm manager
+ * @author ricky barrette
+ */
+ private void registerWakeUp(){
+ AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
+ am.set(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis() + this.mPeriod, PendingIntent.getService(this, REQUEST_CODE, this.mIntent, 0));
+ }
+
+ /**
+ * a convince method for getting an intent to start the service
+ * @param context
+ * @return a intent that will be used to start the service
+ * @author ricky barrette
+ */
+ public static Intent getStartServiceIntent(final Context context){
+ return new Intent(context, SkyHookService.class);
+ }
+
+ /**
+ * a convince method for stopping the service and removing its que from the alarm manager
+ * @param context
+ * @return a runnable that will stop the service
+ * @author ricky barrette
+ */
+ public static Runnable stopService(final Context context){
+ return new Runnable(){
+ @Override
+ public void run(){
+ context.stopService(new Intent(context, SkyHookService.class));
+ ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).cancel(PendingIntent.getService(context, REQUEST_CODE, new Intent(context, SkyHookService.class), 0));
+ }
+ };
+ }
+
+ @Override
+ public void onLocationChanged(GeoPoint point, int accuracy) {
+ this.mLocation = point;
+ this.mAccuracy = accuracy;
+ /*
+ * fail safe
+ * if the accuracy is greater than the minimum required accuracy
+ * then continue
+ * else stop to report location
+ */
+ if(accuracy < (this.mRequiredAccuracy > -1 ? this.mRequiredAccuracy : Debug.MINIMUM_REQUIRED_ACCURACY) || Debug.REPORT_FIRST_LOCATION)
+ this.stopSelf(this.mStartID);
+
+ }
+
+ @Override
+ public void done() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public WPSContinuation handleError(WPSReturnCode arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void handleSuccess() {
+ // TODO Auto-generated method stub
+
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.java
new file mode 100644
index 0000000..7d47523
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/SkyHookUserOverlay.java
@@ -0,0 +1,456 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 2, 2010
+ */
+package com.TwentyCodes.android.SkyHook;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.Paint.Style;
+import android.graphics.Point;
+import android.os.Handler;
+import android.os.SystemClock;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+import com.TwentyCodes.android.location.CompasOverlay;
+import com.TwentyCodes.android.location.CompassListener;
+import com.TwentyCodes.android.location.GeoPointLocationListener;
+import com.TwentyCodes.android.location.GeoUtils;
+import com.google.android.maps.GeoPoint;
+import com.google.android.maps.MapView;
+import com.google.android.maps.Overlay;
+import com.google.android.maps.Projection;
+
+/**
+ * this class will be used to display the users location on the map using skyhook's call back methods
+ * @author ricky barrette
+ */
+public class SkyHookUserOverlay extends Overlay implements GeoPointLocationListener, CompassListener{
+
+ private float mBearing = 0;
+ private int mAccuracy;
+ private GeoPoint mPoint;
+ private Context mContext;
+ private SkyHook mSkyHook;
+ private boolean isEnabled;
+ private MapView mMapView;
+ private ProgressDialog mGPSprogress;
+ private boolean isFistFix = true;
+ private GeoPointLocationListener mListener;
+ public boolean isFollowingUser = true;
+ private final String TAG = "SkyHookUserOverlay";
+ private CompasOverlay mCompass;
+ private boolean isCompassEnabled;
+ private int mUserArrow = R.drawable.user_arrow_animation_1;
+ private volatile Thread mAnimationThread;
+
+ /**
+ * Construct a new SkyHookUserOverlaymFollowUser
+ * @param mapView
+ * @param context
+ * @author ricky barrette
+ */
+ public SkyHookUserOverlay(MapView mapView, Context context) {
+ mContext = context;
+ mMapView = mapView;
+ mSkyHook = new SkyHook(context);
+ mCompass = new CompasOverlay(context);
+ mUserArrow = R.drawable.user_arrow_animation_1;
+ mAnimationThread = new Thread(new Runnable(){
+ @Override
+ public void run(){
+ int index = 0;
+ boolean isCountingUp = true;
+ while(! isEnabled){
+ switch(index){
+ case 1:
+ mUserArrow = R.drawable.user_arrow_animation_2;
+ break;
+ case 2:
+ mUserArrow = R.drawable.user_arrow_animation_3;
+ break;
+ default:
+ mUserArrow = R.drawable.user_arrow_animation_1;
+ try {
+ Thread.sleep(300l);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ return;
+ }
+ break;
+ }
+ try {
+ Thread.sleep(200l);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ if(isCountingUp){
+ if(index++ == 2)
+ isCountingUp = false;
+ } else if(index-- == 0)
+ isCountingUp = true;
+
+ if(! isEnabled)
+ return;
+ }
+ }
+ });
+ }
+
+ /**
+ * Construct a new SkyHookUserOverlay
+ * @param mapView
+ * @param context
+ * @param followUser
+ * @author ricky barrette
+ */
+ public SkyHookUserOverlay(MapView mapView, Context context, boolean followUser) {
+ this(mapView, context);
+ isFollowingUser = followUser;
+ }
+
+ /**
+ * Disables the compass
+ * @author ricky barrette
+ */
+ public void disableCompass(){
+ isCompassEnabled = false;
+ mMapView.getOverlays().remove(mCompass);
+ }
+
+ /**
+ * Stops location updates and removes the overlay from view
+ * @author ricky barrette
+ */
+ public synchronized void disableMyLocation(){
+// mAnimationThread.stop();
+ Log.d(TAG,"disableMyLocation()");
+ mSkyHook.removeUpdates();
+ isEnabled = false;
+ mCompass.disable();
+ mGPSprogress.cancel();
+ }
+
+ /**
+ * Disables the Acquiring GPS dialog
+ * @author ricky barrette
+ */
+ public void disableGPSDialog(){
+ if(mGPSprogress != null)
+ mGPSprogress.dismiss();
+ }
+
+ /**
+ * we override this methods so we can provide a drawable and a location to draw on the canvas.
+ * (non-Javadoc)
+ * @see com.google.android.maps.Overlay#draw(android.graphics.Canvas, com.google.android.maps.MapView, boolean)
+ * @param canvas
+ * @param mapView
+ * @param shadow
+ * @author ricky barrette
+ */
+ @Override
+ public void draw(Canvas canvas, MapView mapView, boolean shadow){
+ if (isEnabled && mPoint != null) {
+ Point center = new Point();
+ Point left = new Point();
+ Projection projection = mapView.getProjection();
+ GeoPoint leftGeo = GeoUtils.distanceFrom(mPoint, mAccuracy);
+ projection.toPixels(leftGeo, left);
+ projection.toPixels(mPoint, center);
+ canvas = drawAccuracyCircle(center, left, canvas);
+ canvas = drawUser(center, mBearing, canvas);
+ /*
+ * the following log is used to demonstrate if the leftGeo point is the correct
+ */
+// Log.d(SkyHook.TAG, (GeoUtils.distanceKm(mPoint, leftGeo) * 1000)+"m");
+ }
+ super.draw(canvas, mapView, shadow);
+ }
+
+ /**
+ * draws an accuracy circle onto the canvas supplied
+ * @param center point of the circle
+ * @param left point of the circle
+ * @param canvas to be drawn on
+ * @return modified canvas
+ * @author ricky barrette
+ */
+ private Canvas drawAccuracyCircle(Point center, Point left, Canvas canvas) {
+ Paint paint = new Paint();
+
+ /*
+ * get radius of the circle being drawn by
+ */
+ int circleRadius = center.x - left.x;
+ if(circleRadius <= 0){
+ circleRadius = left.x - center.x;
+ }
+ /*
+ * paint a blue circle on the map
+ */
+ paint.setAntiAlias(true);
+ paint.setStrokeWidth(2.0f);
+ paint.setColor(Color.BLUE);
+ paint.setStyle(Style.STROKE);
+ canvas.drawCircle(center.x, center.y, circleRadius, paint);
+ /*
+ * fill the radius with a alpha blue
+ */
+ paint.setAlpha(30);
+ paint.setStyle(Style.FILL);
+ canvas.drawCircle(center.x, center.y, circleRadius, paint);
+
+ /*
+ * for testing
+ * draw a dot over the left geopoint
+ */
+// paint.setColor(Color.RED);
+// RectF oval = new RectF(left.x - 1, left.y - 1, left.x + 1, left.y + 1);
+// canvas.drawOval(oval, paint);
+
+ return canvas;
+ }
+
+ /**
+ * draws user arrow that points north based on bearing onto the supplied canvas
+ * @param point to draw user arrow on
+ * @param bearing of the device
+ * @param canvas to draw on
+ * @return modified canvas
+ * @author ricky barrette
+ */
+ private Canvas drawUser(Point point, float bearing, Canvas canvas){
+ Bitmap user = BitmapFactory.decodeResource(mContext.getResources(), mUserArrow);
+ Matrix matrix = new Matrix();
+ matrix.postRotate(bearing);
+ Bitmap rotatedBmp = Bitmap.createBitmap(
+ user,
+ 0, 0,
+ user.getWidth(),
+ user.getHeight(),
+ matrix,
+ true
+ );
+ canvas.drawBitmap(
+ rotatedBmp,
+ point.x - (rotatedBmp.getWidth() / 2),
+ point.y - (rotatedBmp.getHeight() / 2),
+ null
+ );
+ return canvas;
+ }
+
+ /**
+ * Enables the compass
+ * @author ricky barrette
+ */
+ public synchronized void enableCompass(){
+ if(! this.isCompassEnabled){
+ this.mMapView.getOverlays().add(this.mCompass);
+ this.isCompassEnabled = true;
+ }
+ }
+
+ /**
+ * Enables the Acquiring GPS dialog if the location has not been acquired
+ * @author ricky barrette
+ */
+ public void enableGPSDialog(){
+ if(isFistFix)
+ if(mGPSprogress != null){
+ if(! mGPSprogress.isShowing())
+ mGPSprogress = ProgressDialog.show(mContext, "", mContext.getText(R.string.gps_fix), true, true);
+ } else
+ mGPSprogress = ProgressDialog.show(mContext, "", mContext.getText(R.string.gps_fix), true, true);
+ }
+
+ /**
+ * Attempts to enable MyLocation, registering for updates from sky hook
+ * @author ricky barrette
+ */
+ public void enableMyLocation(){
+ Log.d(TAG,"enableMyLocation()");
+ if (! isEnabled) {
+// this.mAnimationThread.start();
+ mSkyHook.setLocationListener(this);
+ mSkyHook.getUpdates();
+ isEnabled = true;
+ mCompass.enable(this);
+ isFistFix = true;
+ enableGPSDialog();
+
+ /**
+ * this is a message that tells the user that we are having trouble getting an GPS signal
+ */
+ new Handler().postAtTime(new Runnable() {
+ @Override
+ public void run() {
+ if (mGPSprogress.isShowing()) {
+ mGPSprogress.cancel();
+ AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
+ builder.setMessage(
+ mContext.getText(R.string.sorry_theres_trouble))
+ .setCancelable(false)
+ .setPositiveButton(mContext.getText(android.R.string.ok),
+ new DialogInterface.OnClickListener() {
+ public void onClick( DialogInterface dialog, int id) {
+ dialog.cancel();
+ }
+ });
+ builder.show();
+ }
+ }
+ }, SystemClock.uptimeMillis()+90000L);
+ }
+ }
+
+ /**
+ * Allows the map to follow the user
+ * @param followUser
+ * @author ricky barrette
+ */
+ public void followUser(boolean followUser){
+ Log.d(TAG,"followUser()");
+ isFollowingUser = followUser;
+ }
+
+ /**
+ * returns the users current bearing
+ * @return
+ * @author ricky barrette
+ */
+ public float getUserBearing(){
+ return mBearing;
+ }
+
+ /**
+ * returns the users current location
+ * @return
+ * @author ricky barrette
+ */
+ public GeoPoint getUserLocation(){
+ return mPoint;
+ }
+
+ @Override
+ public void onCompassUpdate(float bearing) {
+ if(Debug.DEBUG)
+ Log.v(TAG, "onCompassUpdate()");
+ mBearing = bearing;
+ mMapView.invalidate();
+ }
+
+ /**
+ * called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle.
+ * (non-Javadoc)
+ * @see com.TwentyCodes.android.SkyHook.GeoPointLocationListener.location.LocationListener#onLocationChanged(com.google.android.maps.GeoPoint, float)
+ * @param point
+ * @param accuracy
+ * @author ricky barrette
+ */
+ @Override
+ public void onLocationChanged(GeoPoint point, int accuracy) {
+
+ if(mCompass != null)
+ mCompass.setLocation(point);
+
+ /*
+ * if this is the first fix
+ * set map center the users location, and zoom to the max zoom level
+ */
+ if(point != null && isFistFix){
+ mMapView.getController().setCenter(point);
+ mMapView.getController().setZoom( (mMapView.getMaxZoomLevel() - 2) );
+ mGPSprogress.dismiss();
+ isFistFix = false;
+ }
+
+ //update the users point, and accuracy for the UI
+ mPoint = point;
+ mAccuracy = accuracy;
+ mMapView.invalidate();
+ if(mListener != null){
+ mListener.onLocationChanged(point, accuracy);
+ }
+
+ if (isFollowingUser) {
+ panToUserIfOffMap(point);
+ }
+ }
+
+ /**
+ * pans the map view if the user is off screen.
+ * @author ricky barrette
+ */
+ private void panToUserIfOffMap(GeoPoint user) {
+ GeoPoint center = mMapView.getMapCenter();
+ double distance = GeoUtils.distanceKm(center, user);
+ double distanceLat = GeoUtils.distanceKm(center, new GeoPoint((center.getLatitudeE6() + (int) (mMapView.getLatitudeSpan() / 2)), center.getLongitudeE6()));
+ double distanceLon = GeoUtils.distanceKm(center, new GeoPoint(center.getLatitudeE6(), (center.getLongitudeE6() + (int) (mMapView.getLongitudeSpan() / 2))));
+
+ double whichIsGreater = (distanceLat > distanceLon) ? distanceLat : distanceLon;
+
+ /**
+ * if the user is one the map, keep them their
+ * else don't pan to user unless they pan pack to them
+ */
+ if( ! (distance > whichIsGreater) )
+ if (distance > distanceLat || distance > distanceLon){
+ mMapView.getController().animateTo(user);
+ }
+ }
+
+ /**
+ * Attempts to register the listener for location updates
+ * @param listener
+ * @author Ricky Barrette
+ */
+ public void registerListener(GeoPointLocationListener listener){
+ Log.d(TAG,"registerListener()");
+ if (mListener == null){
+ mListener = listener;
+ }
+ }
+
+ /**
+ * Sets the destination for the compass
+ * @author ricky barrette
+ */
+ public void setDestination(GeoPoint destination){
+ if(mCompass != null)
+ mCompass.setDestination(destination);
+ }
+
+ /**
+ * UnResgisters the listener. after this call you will no longer get location updates
+ * @author Ricky Barrette
+ */
+ public void unRegisterListener(){
+ Log.d(TAG,"unRegisterListener()");
+ mListener = null;
+ }
+
+ /**
+ * Set the compass drawables and location
+ * @param needleResId
+ * @param backgroundResId
+ * @param x
+ * @param y
+ * @author ricky barrette
+ */
+ public void setCompassDrawables(int needleResId, int backgroundResId, int x, int y) {
+ mCompass.setDrawables(needleResId, backgroundResId, x, y);
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/SkyHook/Splash.java b/LocationLib/src/com/TwentyCodes/android/SkyHook/Splash.java
new file mode 100644
index 0000000..90ba2ff
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/SkyHook/Splash.java
@@ -0,0 +1,48 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Nov 3, 2010
+ */
+package com.TwentyCodes.android.SkyHook;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+
+/**
+ * this activity will be used to display the Twenty Codes, LLC and Skyhook Wireless Splash Screen
+ * @author ricky barrette
+ */
+public class Splash extends Activity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState){
+ setContentView(R.layout.powered_by_skyhook);
+
+ new Handler().postDelayed( new Runnable() {
+ @Override
+ public void run(){
+ finish();
+ }
+ } , 1500L);
+
+ super.onCreate(savedInstanceState);
+ }
+
+ /**
+ * a convince method for starting the splash screen activity
+ * @param context
+ * @return a runnable that will start the splash screen
+ * @author ricky barrette
+ */
+ public static Runnable showSpashScreen(final Context context){
+ return new Runnable() {
+ @Override
+ public void run(){
+ context.startActivity(new Intent(context, com.TwentyCodes.android.SkyHook.Splash.class));
+ }
+ };
+ }
+}
diff --git a/LocationLib/src/com/TwentyCodes/android/debug/Debug.java b/LocationLib/src/com/TwentyCodes/android/debug/Debug.java
new file mode 100644
index 0000000..03319d7
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/debug/Debug.java
@@ -0,0 +1,52 @@
+/**
+ * Debug.java
+ * @date Mar 1, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.debug;
+
+import android.hardware.SensorManager;
+
+/**
+ * This class will be used to enable and disable debugging features
+ * @author ricky barrette
+ */
+public final class Debug {
+
+ /**
+ * Sets the logging level for this library
+ * @author ricky barrette
+ */
+ public static final boolean DEBUG = false;
+
+ /**
+ * Sets the default SkyHook Registration Behavior used by SkyHookRegistration.getUserName()
+ * @author ricky barrette
+ */
+ public static final SkyHookRegistrationBehavior DEFAULT_REGISTRATION_BEHAVIOR = SkyHookRegistrationBehavior.NORMAL;
+
+ /**
+ * Sets the default compass sensor update interval
+ * @author ricky barrette
+ */
+ public static final int COMPASS_UPDATE_INTERVAL = SensorManager.SENSOR_DELAY_UI;
+
+ /**
+ * The maximum running time for a single shot location service
+ * @author ricky barrette
+ */
+ public static final long MAX_LOCATION_SERVICE_RUN_TIME = 60000l;
+
+ /**
+ * Forces single shot location services to return the first location
+ * @author ricky barrette
+ */
+ public static final boolean REPORT_FIRST_LOCATION = false;
+
+ /**
+ * Minimum Required accuracy to report
+ * @author ricky barrette
+ */
+ public static final int MINIMUM_REQUIRED_ACCURACY = 50;
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.java b/LocationLib/src/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.java
new file mode 100644
index 0000000..29004cf
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/debug/SkyHookRegistrationBehavior.java
@@ -0,0 +1,30 @@
+/**
+ * SkyHookTesting.java
+ * @date Mar 1, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.debug;
+
+/**
+ * This enum will be used to select the testing level
+ * @author ricky barrette
+ */
+public enum SkyHookRegistrationBehavior {
+
+ /**
+ * Used to force SkyHookRegistration.getUserName to behave normally
+ */
+ NORMAL,
+
+ /**
+ * Used to force SkyHookRegistration.getUserName to return the testing user name
+ */
+ USE_TESTING_USERNAME,
+
+ /**
+ * Used to force SkyHookRegistration.getUserName to return null
+ */
+ RETURN_NULL;
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/AndroidGPS.java b/LocationLib/src/com/TwentyCodes/android/location/AndroidGPS.java
new file mode 100644
index 0000000..fb5effb
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/AndroidGPS.java
@@ -0,0 +1,146 @@
+/**
+ * AndroidGPS.java
+ * @date Feb 3, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.location;
+
+import android.content.Context;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.TwentyCodes.android.SkyHook.SkyHook;
+import com.TwentyCodes.android.debug.Debug;
+import com.google.android.maps.GeoPoint;
+
+/**
+ * This class will be used for gathering location using android's location services
+ * @author ricky barrette
+ */
+public class AndroidGPS implements LocationListener {
+
+ private static final String TAG = "AndroidGPS";
+ private LocationManager mLocationManager;
+ private GeoPointLocationListener mListener;
+ private LocationListener mLocationListener;
+
+ /**
+ * Creates a new SkyHookFallback
+ * @author ricky barrette
+ */
+ public AndroidGPS(Context context) {
+ mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
+ }
+
+ /**
+ * Remove updates from androids location services
+ * @author ricky barrette
+ */
+ public void disableLocationUpdates(){
+ if(Debug.DEBUG)
+ Log.d(TAG, "disableLocationUpdates()");
+ mListener = null;
+ mLocationManager.removeUpdates(this);
+ }
+
+ /**
+ * Attempts to enable periodic location updates
+ * @param listener
+ * @author ricky barrette
+ */
+ public void enableLocationUpdates(LocationListener listener) {
+ if(Debug.DEBUG)
+ Log.d(SkyHook.TAG, "enableLocationUpdates()");
+ if(mLocationListener == null){
+ mLocationListener = listener;
+ requestUpdates();
+ }
+ }
+
+ /**
+ * request periodic location updates from androids location services
+ * @author ricky barrette
+ */
+ public void enableLocationUpdates(GeoPointLocationListener listener) {
+ if(Debug.DEBUG)
+ Log.d(SkyHook.TAG, "enableLocationUpdates()");
+ if (mListener == null) {
+ mListener = listener;
+ requestUpdates();
+ }
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.location.LocationListener#onLocationChanged(android.location.Location)
+ * @param location
+ * @author ricky barrette
+ */
+ @Override
+ public void onLocationChanged(Location location) {
+ if(mListener != null)
+ mListener.onLocationChanged(new GeoPoint( (int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)), (int) location.getAccuracy());
+
+ if(mLocationListener != null){
+ mLocationListener.onLocationChanged(location);
+ }
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.location.LocationListener#onProviderDisabled(java.lang.String)
+ * @param arg0
+ * @author ricky barrette
+ */
+ @Override
+ public void onProviderDisabled(String arg0) {
+ // UNUSED
+
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.location.LocationListener#onProviderEnabled(java.lang.String)
+ * @param arg0
+ * @author ricky barrette
+ */
+ @Override
+ public void onProviderEnabled(String arg0) {
+ // UNUSED
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.location.LocationListener#onStatusChanged(java.lang.String, int, android.os.Bundle)
+ * @param arg0
+ * @param arg1
+ * @param arg2
+ * @author ricky barrette
+ */
+ @Override
+ public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
+ // UNUSED
+ }
+
+ /**
+ * Request updates from android location services
+ * @author ricky barrette
+ */
+ private void requestUpdates() {
+ mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
+ mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
+ try {
+ mLocationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER, 0, 0, this);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ /* We do no handle this exception as it is caused if the android version is < 1.6. since the PASSIVE_PROVIDER call is not required
+ * to function we can ignore it.
+ */
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/CompasOverlay.java b/LocationLib/src/com/TwentyCodes/android/location/CompasOverlay.java
new file mode 100644
index 0000000..793e33c
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/CompasOverlay.java
@@ -0,0 +1,234 @@
+/**
+ * CompasOverlay.java
+ * @date Mar 9, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.location;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Point;
+
+import com.TwentyCodes.android.SkyHook.R;
+import com.google.android.maps.GeoPoint;
+import com.google.android.maps.MapView;
+import com.google.android.maps.Overlay;
+
+/**
+ * A Simple compass overlay that will be used to point towards a destination or north
+ * @author ricky barrette
+ */
+public class CompasOverlay extends Overlay implements CompassListener {
+
+ private float mBearing;
+ private Context mContext;
+ private GeoPoint mDestination;
+ private GeoPoint mLocation;
+ private boolean isEnabled;
+ private CompassSensor mCompassSensor;
+ private int mNeedleResId = R.drawable.needle;
+ private int mBackgroundResId = R.drawable.compass;
+ private int mX = 100;
+ private int mY = 100;
+ private CompassListener mListener;
+
+ /**
+ * Creates a new CompasOverlay
+ * @author ricky barrette
+ */
+ public CompasOverlay(Context context) {
+ mContext = context;
+ mCompassSensor = new CompassSensor(context);
+ }
+
+ /**
+ * Creates a new CompasOverlay
+ * @param context
+ * @param destination
+ * @author ricky barrette
+ */
+ public CompasOverlay(Context context, GeoPoint destination){
+ this(context);
+ mDestination = destination;
+ }
+
+ /**
+ * Creates a new CompasOverlay
+ * @param context
+ * @param needleResId
+ * @param backgroundResId
+ * @param x
+ * @param y
+ * @author ricky barrette
+ */
+ public CompasOverlay(Context context, int needleResId, int backgroundResId, int x, int y){
+ this(context, null, needleResId, backgroundResId, x, y);
+ }
+
+ /**
+ * Creates a new CompasOverlay
+ * @param context
+ * @param destination
+ * @param needleResId
+ * @param backgroundResId
+ * @param x
+ * @param y
+ * @author ricky barrette
+ */
+ public CompasOverlay(Context context, GeoPoint destination, int needleResId, int backgroundResId, int x, int y){
+ this(context, destination);
+ mX = x;
+ mY = y;
+ mNeedleResId = needleResId;
+ mBackgroundResId = backgroundResId;
+ }
+
+ /**
+ * Calculated the bearing from the current location to the current destination, or returns the bearing for north if there is no destination
+ * @return bearing
+ * @author ricky barrette
+ */
+ private float calculateBearing() {
+ if( (mLocation == null) || (mDestination == null) )
+ return mBearing;
+
+ float bearing = mBearing - GeoUtils.bearing(mLocation, mDestination).floatValue();
+ if (bearing != 0)
+ bearing = 360 - bearing;
+
+ return bearing;
+ }
+
+ /**
+ * Disables the compass overlay
+ * @author ricky barrette
+ */
+ public void disable(){
+ isEnabled = false;
+ mCompassSensor.disable();
+ mListener = null;
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see com.google.android.maps.Overlay#draw(android.graphics.Canvas, com.google.android.maps.MapView, boolean)
+ * @author ricky barrette
+ */
+ @Override
+ public void draw(Canvas canvas, MapView mapView, boolean shadow) {
+
+ if(isEnabled){
+ //set the center of the compass in the top left corner of the screen
+ Point point = new Point();
+ point.set(mX, mY);
+
+ //draw compass background
+ Bitmap compass = BitmapFactory.decodeResource( mContext.getResources(), mBackgroundResId);
+ canvas.drawBitmap(compass,
+ point.x - (compass.getWidth() / 2),
+ point.y - (compass.getHeight() / 2),
+ null
+ );
+
+ //draw the compass needle
+ Bitmap arrowBitmap = BitmapFactory.decodeResource( mContext.getResources(), mNeedleResId);
+ Matrix matrix = new Matrix();
+ matrix.postRotate(calculateBearing());
+ Bitmap rotatedBmp = Bitmap.createBitmap(
+ arrowBitmap,
+ 0, 0,
+ arrowBitmap.getWidth(),
+ arrowBitmap.getHeight(),
+ matrix,
+ true
+ );
+ canvas.drawBitmap(
+ rotatedBmp,
+ point.x - (rotatedBmp.getWidth() / 2),
+ point.y - (rotatedBmp.getHeight() / 2),
+ null
+ );
+ mapView.invalidate();
+ }
+ super.draw(canvas, mapView, shadow);
+ }
+
+ /**
+ * Enables the compass overlay
+ * @author ricky barrette
+ */
+ public void enable(){
+ if(! isEnabled){
+ isEnabled = true;
+ mCompassSensor.enable(this);
+ }
+ }
+
+ /**
+ * Enables the compass overlay
+ * @param listener
+ * @author ricky barrette
+ */
+ public void enable(CompassListener listener){
+ mListener = listener;
+ enable();
+ }
+
+ /**
+ * @return the current bearing
+ * @author ricky barrette
+ */
+ public float getBearing(){
+ return mBearing;
+ }
+
+ /**
+ * Called from the compass Sensor to update the current bearing
+ * (non-Javadoc)
+ * @see com.TwentyCodes.android.location.CompassListener#onCompassUpdate(float)
+ * @author ricky barrette
+ */
+ @Override
+ public void onCompassUpdate(float bearing) {
+ mBearing = bearing;
+
+ /*
+ * pass it down the chain
+ */
+ if(mListener != null)
+ mListener.onCompassUpdate(bearing);
+ }
+
+ /**
+ * @param destination
+ * @author ricky barrette
+ */
+ public void setDestination(GeoPoint destination){
+ mDestination = destination;
+ }
+
+ /**
+ * @param needleResId
+ * @param backgroundResId
+ * @author ricky barrette
+ */
+ public void setDrawables(int needleResId, int backgroundResId, int x, int y){
+ mX = x;
+ mY = y;
+ mNeedleResId = needleResId;
+ mBackgroundResId = backgroundResId;
+ }
+
+ /**
+ * @param location
+ * @author ricky barrette
+ */
+ public void setLocation(GeoPoint location){
+ mLocation = location;
+ }
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/CompassListener.java b/LocationLib/src/com/TwentyCodes/android/location/CompassListener.java
new file mode 100644
index 0000000..2e77771
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/CompassListener.java
@@ -0,0 +1,21 @@
+/**
+ * CompassListener.java
+ * @date Mar 2, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.location;
+
+/**
+ * A simple listener interface to get updates from CompassSensor
+ * @author ricky barrette
+ */
+public interface CompassListener {
+
+ /**
+ * Called when there is an update from the Compass Sensor
+ * @param bearing
+ * @author ricky barrette
+ */
+ public void onCompassUpdate(float bearing);
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/CompassSensor.java b/LocationLib/src/com/TwentyCodes/android/location/CompassSensor.java
new file mode 100644
index 0000000..64af5f1
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/CompassSensor.java
@@ -0,0 +1,138 @@
+/**
+ * CompassSensor.java
+ * @date Mar 2, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+package com.TwentyCodes.android.location;
+
+import android.content.Context;
+import android.content.res.Configuration;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.os.Handler;
+import android.os.Message;
+
+import com.TwentyCodes.android.debug.Debug;
+
+/**
+ * A simple convince class that accesses the compass sensor on another thread
+ * @author ricky barrette
+ */
+public class CompassSensor{
+
+ private static final int BEARING = 0;
+ private SensorManager mSensorManager;
+ private Context mContext;
+ private CompassListener mListener;
+ private Handler mHandler;
+ private SensorCallBack mCallBack;
+
+ /**
+ * A convince callback class for the compass sensor
+ * @author ricky barrette
+ */
+ private class SensorCallBack implements SensorEventListener {
+
+ /**
+ * (non-Javadoc)
+ * @see android.hardware.SensorEventListener#onAccuracyChanged(android.hardware.Sensor, int)
+ * @author ricky barrette
+ */
+ @Override
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
+ // NOT USED
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.hardware.SensorEventListener#onSensorChanged(android.hardware.SensorEvent)
+ * @author ricky barrette
+ */
+ @Override
+ public void onSensorChanged(SensorEvent event) {
+ float myAzimuth = event.values[0];
+ // myPitch = event.values[1];
+ float roll = event.values[2];
+
+ if (mContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
+
+ boolean isNormal = false;
+ if (roll <= -25)
+ isNormal = false;
+
+ if (roll >= 25)
+ isNormal = true;
+
+ if (isNormal)
+ myAzimuth = myAzimuth + 90;
+ else
+ myAzimuth = myAzimuth - 90;
+ }
+
+ mHandler.sendMessage(mHandler.obtainMessage(BEARING, myAzimuth));
+ }
+
+
+ }
+
+ /**
+ * Creates a new CompassSensor
+ * @author ricky barrette
+ */
+ public CompassSensor(Context context) {
+ mContext = context;
+ setUiHandler();
+
+ //start getting information from the compass sensor
+ new Thread(new Runnable(){
+ @Override
+ public void run() {
+ mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
+ }
+ }).start();
+ mCallBack = new SensorCallBack();
+ }
+
+ /**
+ * Disables compass updates
+ * @author ricky barrette
+ */
+ public void disable(){
+ mListener = null;
+ mSensorManager.unregisterListener(mCallBack);
+ }
+
+ /**
+ * Attempts to register the listener for compass updates
+ * @param listener
+ * @author ricky barrette
+ */
+ public void enable(CompassListener listener){
+ if(mListener == null) {
+ mListener = listener;
+ if(mSensorManager == null)
+ mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
+ mSensorManager.registerListener(mCallBack, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), Debug.COMPASS_UPDATE_INTERVAL);
+ }
+ }
+
+ /**
+ * Sets up the UI handler
+ * @author ricky barrette
+ */
+ private void setUiHandler() {
+ mHandler = new Handler(){
+ @Override
+ public void handleMessage(Message msg){
+ System.out.print((Float) msg.obj);
+ if(mListener != null)
+ if(msg.what == BEARING)
+ mListener.onCompassUpdate((Float) msg.obj);
+ }
+ };
+ }
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/GeoPointLocationListener.java b/LocationLib/src/com/TwentyCodes/android/location/GeoPointLocationListener.java
new file mode 100644
index 0000000..fed0162
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/GeoPointLocationListener.java
@@ -0,0 +1,23 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 2, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import com.google.android.maps.GeoPoint;
+
+/**
+ * this interface will be used to interface with skyhook sdk with the rest of the application
+ * @author ricky barrette
+ */
+public interface GeoPointLocationListener {
+
+ /**
+ * Called when the location has changed
+ * @param point
+ * @param accuracy
+ * @author ricky barrette
+ */
+ public void onLocationChanged(GeoPoint point, int accuracy);
+}
diff --git a/LocationLib/src/com/TwentyCodes/android/location/GeoUtils.java b/LocationLib/src/com/TwentyCodes/android/location/GeoUtils.java
new file mode 100644
index 0000000..d14576d
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/GeoUtils.java
@@ -0,0 +1,232 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author Google Inc.
+ * @author ricky barrette
+ * @date Oct 2, 2010
+ *
+ * Some Code here is Copyright (C) 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.TwentyCodes.android.location;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import android.graphics.Point;
+
+import com.google.android.maps.GeoPoint;
+import com.google.android.maps.MapView;
+
+/**
+ * This class contains common tools for computing common geological problems
+ * @author ricky barrette
+ * @author Google Inc.
+ */
+public class GeoUtils {
+
+ public static final int EARTH_RADIUS_KM = 6371;
+ public static final double MILLION = 1000000;
+
+ /**
+ * computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+ * @param lat1 source lat
+ * @param lon1 source lon
+ * @param lat2 destination lat
+ * @param lon2 destination lon
+ * @return the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+ * @author Google Inc.
+ */
+ public static double bearing(double lat1, double lon1, double lat2, double lon2) {
+ double lat1Rad = Math.toRadians(lat1);
+ double lat2Rad = Math.toRadians(lat2);
+ double deltaLonRad = Math.toRadians(lon2 - lon1);
+ double y = Math.sin(deltaLonRad) * Math.cos(lat2Rad);
+ double x = Math.cos(lat1Rad) * Math.sin(lat2Rad) - Math.sin(lat1Rad) * Math.cos(lat2Rad) * Math.cos(deltaLonRad);
+ return radToBearing(Math.atan2(y, x));
+ }
+
+ /**
+ * computes the bearing of lat2/lon2 in relationship from lat1/lon1 in degrees East
+ * @param p1 source geopoint
+ * @param p2 destination geopoint
+ * @return the bearing of p2 in relationship from p1 in degrees East
+ * @author Google Inc.
+ */
+ public static Double bearing(GeoPoint p1, GeoPoint p2) {
+ double lat1 = p1.getLatitudeE6() / MILLION;
+ double lon1 = p1.getLongitudeE6() / MILLION;
+ double lat2 = p2.getLatitudeE6() / MILLION;
+ double lon2 = p2.getLongitudeE6() / MILLION;
+ return bearing(lat1, lon1, lat2, lon2);
+ }
+
+ /**
+ * Calculates a geopoint x meters away of the geopoint supplied. The new geopoint
+ * shares the same latitude as geopoint point, this way they are on the same latitude arc.
+ *
+ * @param point central geopoint
+ * @param distance in meters from the geopoint
+ * @return geopoint that is x meters away from the geopoint supplied
+ * @author ricky barrette
+ */
+ public static GeoPoint distanceFrom(GeoPoint point, double distance){
+ //convert meters into kilometers
+ distance = distance / 1000;
+
+ // convert lat and lon of geopoint to radians
+ double lat1Rad = Math.toRadians((point.getLatitudeE6() / 1e6));
+ double lon1Rad = Math.toRadians((point.getLongitudeE6() / 1e6));
+
+ /*
+ * kilometers = acos(sin(lat1Rad)sin(lat2Rad)+cos(lat1Rad)cos(lat2Rad)cos(lon2Rad-lon1Rad)6371
+ *
+ * we are solving this equation for lon2Rad
+ *
+ * lon2Rad = lon1Rad+acos(cos(meters/6371)sec(lat1Rad)sec(lat2Rad)-tan(lat1Rad)tan(lat2Rad))
+ *
+ * NOTE: sec(x) = 1/cos(x)
+ *
+ * NOTE: that lat2Rad is = lat1Rad because we want to keep the new geopoint on the same lat arc
+ * therefore i saw no need to create a new variable for lat2Rad,
+ * and simply inputed lat1Rad in place of lat2Rad in the equation
+ *
+ * NOTE: this equation has be tested in the field against another gps device, and the distanceKm() from google
+ * and has been proven to be damn close
+ */
+ double lon2Rad = lon1Rad + Math.acos( Math.cos((distance/6371)) * (1 / Math.cos(lat1Rad))
+ * (1 / Math.cos(lat1Rad)) - Math.tan(lat1Rad) * Math.tan(lat1Rad));
+
+ //return a geopoint that is x meters away from the geopoint supplied
+ return new GeoPoint(point.getLatitudeE6(), (int) (Math.toDegrees(lon2Rad) * 1e6));
+ }
+
+ /**
+ * computes the distance between to lat1/lon1 and lat2/lon2 based on the curve of the earth
+ * @param lat1 source lat
+ * @param lon1 source lon
+ * @param lat2 destination lat
+ * @param lon2 destination lon
+ * @return the distance between to lat1/lon1 and lat2/lon2
+ * @author Google Inc.
+ */
+ public static double distanceKm(double lat1, double lon1, double lat2, double lon2) {
+ double lat1Rad = Math.toRadians(lat1);
+ double lat2Rad = Math.toRadians(lat2);
+ double deltaLonRad = Math.toRadians(lon2 - lon1);
+ return Math.acos(Math.sin(lat1Rad) * Math.sin(lat2Rad) + Math.cos(lat1Rad) * Math.cos(lat2Rad) * Math.cos(deltaLonRad)) * EARTH_RADIUS_KM;
+ }
+
+ /**
+ * a convince method for testing if 2 circles on the the surface of the earth intersect.
+ * we will use this method to test if the users accuracy circle intersects a marked locaton's radius
+ * if ( (accuracyCircleRadius + locationRadius) - fudgeFactor) > acos(sin(lat1Rad)sin(lat2Rad)+cos(lat1Rad)cos(lat2Rad)cos(lon2Rad-lon1Rad)6371
+ * @param userPoint
+ * @param accuracyRadius in KM
+ * @param locationPoint
+ * @param locationRadius in KM
+ * @param fudgeFactor how many KM the circles have to intersect
+ * @return true if the circles intersect
+ * @author ricky barrette
+ */
+ public static boolean isIntersecting(GeoPoint userPoint, float accuracyRadius, GeoPoint locationPoint, float locationRadius, float fudgeFactor){
+ if(((accuracyRadius + locationRadius) - fudgeFactor) > distanceKm(locationPoint, userPoint))
+ return true;
+ return false;
+ }
+
+ /**
+ * computes the distance between to p1 and p2 based on the curve of the earth
+ * @param p1
+ * @param p2
+ * @return the distance between to p1 and p2
+ * @author Google Inc.
+ */
+ public static double distanceKm(GeoPoint p1, GeoPoint p2) {
+ //if we are handed a null, return -1 so we don't break
+ if(p1 == null || p2 == null)
+ return -1;
+
+ double lat1 = p1.getLatitudeE6() / MILLION;
+ double lon1 = p1.getLongitudeE6() / MILLION;
+ double lat2 = p2.getLatitudeE6() / MILLION;
+ double lon2 = p2.getLongitudeE6() / MILLION;
+ return distanceKm(lat1, lon1, lat2, lon2);
+ }
+
+ /**
+ * determines when the specified point is off the map
+ * @param point
+ * @return true is the point is off the map
+ * @author ricky barrette
+ */
+ public static boolean isPointOffMap(MapView map , GeoPoint point){
+ if(map == null)
+ return false;
+ if (point == null)
+ return false;
+ GeoPoint center = map.getMapCenter();
+ double distance = GeoUtils.distanceKm(center, point);
+ double distanceLat = GeoUtils.distanceKm(center, new GeoPoint((center.getLatitudeE6() + (int) (map.getLatitudeSpan() / 2)), center.getLongitudeE6()));
+ double distanceLon = GeoUtils.distanceKm(center, new GeoPoint(center.getLatitudeE6(), (center.getLongitudeE6() + (int) (map.getLongitudeSpan() / 2))));
+ if (distance > distanceLat || distance > distanceLon){
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * computes a geopoint the is the central geopoint between p1 and p1
+ * @param p1 first geopoint
+ * @param p2 second geopoint
+ * @return a MidPoint object
+ * @author ricky barrette
+ */
+ public static MidPoint midPoint(GeoPoint p1, GeoPoint p2) {
+ int minLatitude = (int)(+81 * 1E6);
+ int maxLatitude = (int)(-81 * 1E6);
+ int minLongitude = (int)(+181 * 1E6);
+ int maxLongitude = (int)(-181 * 1E6);
+ List mPoints = new ArrayList();
+ int latitude = p1.getLatitudeE6();
+ int longitude = p1.getLongitudeE6();
+ if (latitude != 0 && longitude !=0) {
+ minLatitude = (minLatitude > latitude) ? latitude : minLatitude;
+ maxLatitude = (maxLatitude < latitude) ? latitude : maxLatitude;
+ minLongitude = (minLongitude > longitude) ? longitude : minLongitude;
+ maxLongitude = (maxLongitude < longitude) ? longitude : maxLongitude;
+ mPoints.add(new Point(latitude, longitude));
+ }
+
+ latitude = p2.getLatitudeE6();
+ longitude = p2.getLongitudeE6();
+ if (latitude != 0 && longitude !=0) {
+ minLatitude = (minLatitude > latitude) ? latitude : minLatitude;
+ maxLatitude = (maxLatitude < latitude) ? latitude : maxLatitude;
+ minLongitude = (minLongitude > longitude) ? longitude : minLongitude;
+ maxLongitude = (maxLongitude < longitude) ? longitude : maxLongitude;
+ mPoints.add(new Point(latitude, longitude));
+ }
+ return new MidPoint(new GeoPoint((maxLatitude + minLatitude)/2, (maxLongitude + minLongitude)/2 ), minLatitude, minLongitude, maxLatitude, maxLongitude);
+ }
+
+ /**
+ * converts radians to bearing
+ * @param rad
+ * @return bearing
+ * @author Google Inc.
+ */
+ public static double radToBearing(double rad) {
+ return (Math.toDegrees(rad) + 360) % 360;
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/LocationReceiver.java b/LocationLib/src/com/TwentyCodes/android/location/LocationReceiver.java
new file mode 100644
index 0000000..cfd365e
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/LocationReceiver.java
@@ -0,0 +1,46 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 18, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.location.Location;
+
+/**
+ * this abstract class will be used as a for classes wishing to be a receiver of location updates from the location services
+ * @author ricky barrette
+ */
+public abstract class LocationReceiver extends BroadcastReceiver {
+
+ public static final String INTENT_EXTRA_ACTION_UPDATE = "TwentyCodes.intent.action.LocationUpdate";
+ public static final String INTENT_EXTRA_LOCATION_PARCEL = "location_parcel";
+ public Context mContext;
+
+ /**
+ * (non-Javadoc)
+ * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
+ * @param contextonBind
+ * @param intent
+ * @author ricky barrette
+ */
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ mContext = context;
+ if(intent.getParcelableExtra(INTENT_EXTRA_LOCATION_PARCEL) != null){
+ Location location = intent.getParcelableExtra(INTENT_EXTRA_LOCATION_PARCEL);
+ onLocationUpdate(location);
+ }
+ }
+
+ /**
+ * called when a location update is received
+ * @param parcelableExtra
+ * @author ricky barrette
+ */
+ public abstract void onLocationUpdate(Location location);
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/LocationService.java b/LocationLib/src/com/TwentyCodes/android/location/LocationService.java
new file mode 100644
index 0000000..43f4304
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/LocationService.java
@@ -0,0 +1,255 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 28, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import java.util.Calendar;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.location.Location;
+import android.location.LocationListener;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.PowerManager;
+import android.os.PowerManager.WakeLock;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+
+/**
+ * This service class will be used broadcast the users location either one time, or periodically.
+ * To use as a one shot location service:
+ * PendingIntent pendingIntent = PendingIntent.getService(context, 0, LocationService.startService(context), 0);
+ * or
+ * Intent service = new Intent(context, LocationService.class);
+ * context.startService(service);
+ * To use as a recurring service:
+ * LocationService.startService(this, (60000 * Integer.parseInt(ringer.getString(UPDATE_INTVERVAL , "5")))).run();
+ * @author ricky barrette
+ */
+public class LocationService extends Service implements LocationListener {
+
+ /**
+ * Used to tell the service how frequently it needs to run. This is required if you want a multishot service
+ */
+ public static final String INTENT_EXTRA_PERIOD_BETWEEN_UPDATES = "period_beween_updates";
+
+ /**
+ * Used to tell the service how accurate of a location you want reported
+ */
+ public static final String INTENT_EXTRA_REQUIRED_ACCURACY = "required_accuracy";
+
+ /**
+ * Used to tell the service the update action to broadcast. If this is not supplied, {@link LocationReceiver.INTENT_EXTRA_ACTION_UPDATE } will be used.
+ * @see LocationReceiver.INTENT_EXTRA_ACTION_UPDATE
+ */
+ public static final String INTENT_EXTRA_ACTION_UPDATE = "action_update";
+
+ public static final String TAG = "LocationService";
+ private static final int REQUEST_CODE = 7893749;
+ private WakeLock mWakeLock;
+ private long mPeriod = -1;
+ private Location mLocation;
+ private int mStartId;
+ private AndroidGPS mLocationManager;
+ private int mRequiredAccuracy;
+ private Intent mIntent;
+ /*
+ * this runnable will be qued when the service is created. this will be used as a fail safe
+ */
+ private Runnable failSafe = new Runnable() {
+ @Override
+ public void run(){
+ stopSelf(mStartId);
+ }
+ };
+
+
+ /**
+ * registers this service to be waken up by android's alarm manager
+ * @author ricky barrette
+ */
+ private void registerwakeUp(){
+ Log.d(TAG, "registerwakeUp()");
+ AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
+ am.set(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis() + this.mPeriod, PendingIntent.getService(this, REQUEST_CODE, this.mIntent, 0));
+ }
+
+ /**
+ * broadcasts location to anything listening for updates,
+ * since this is the last function of the service, we call finish()u
+ * @author ricky barrette
+ */
+ private void broadcastLocation() {
+ Log.d(TAG, "broadcastLocation()");
+ if (mLocation != null) {
+ Intent locationUpdate = new Intent();
+ if(mIntent.getAction() != null)
+ locationUpdate.setAction(mIntent.getAction());
+ else
+ locationUpdate.setAction(LocationReceiver.INTENT_EXTRA_ACTION_UPDATE);
+ locationUpdate.putExtra(LocationReceiver.INTENT_EXTRA_LOCATION_PARCEL, mLocation);
+ sendBroadcast(locationUpdate);
+ stopSelf(mStartId);
+ }
+ }
+
+ /**
+ * called when the service is created. this will initialize the location manager, and acquire a wakelock
+ * (non-Javadoc)
+ * @see android.app.Service#onCreate()
+ * @author ricky barrette
+ */
+ @Override
+ public void onCreate(){
+ mLocationManager = new AndroidGPS(this);
+ PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
+ mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
+ mWakeLock.acquire();
+
+ /*
+ * que the fail safe runnable to kill the report location and kill it self after the MAX_RUN_TIME has been meet
+ */
+ new Handler().postDelayed(failSafe, Debug.MAX_LOCATION_SERVICE_RUN_TIME);
+ super.onCreate();
+ }
+
+ /**
+ * called when the service is destroyed.
+ * this will remove any wakelock or location service running, and register to be waken back up
+ * (non-Javadoc)
+ * @see android.app.Service#onDestroy()
+ * @author ricky barrette
+ */
+ @Override
+ public void onDestroy(){
+ broadcastLocation();
+ mLocationManager.disableLocationUpdates();
+ if(mWakeLock.isHeld())
+ mWakeLock.release();
+ if(mPeriod > -1)
+ registerwakeUp();
+ }
+
+ /**
+ * To keep backwards compatibility we override onStart which is the equivalent of onStartCommand in pre android 2.x
+ * @author ricky barrette
+ */
+ @Override
+ public void onStart(Intent intent, int startId) {
+ if(Debug.DEBUG)
+ Log.i(TAG, "onStart.Service started with start id of: " + startId);
+ mStartId = startId;
+
+ parseIntent(intent);
+
+ mLocationManager.enableLocationUpdates(this);
+ }
+
+ /**
+ * This method is called when startService is called. only used in 2.x android.
+ * @author ricky barrette
+ */
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ if(Debug.DEBUG)
+ Log.i(TAG , "onStartCommand.Service started with start id of: " + startId);
+ mStartId = startId;
+
+ parseIntent(intent);
+
+ mLocationManager.enableLocationUpdates(this);
+ return START_STICKY;
+ }
+
+ /**
+ * Parses the incoming intent for the service options
+ *
+ * @author ricky barrette
+ */
+ private void parseIntent(Intent intent){
+
+ this.mIntent = intent;
+
+ if (intent.hasExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES))
+ mPeriod = intent.getLongExtra(INTENT_EXTRA_PERIOD_BETWEEN_UPDATES, 60000L);
+
+ if (intent.hasExtra(INTENT_EXTRA_REQUIRED_ACCURACY))
+ mRequiredAccuracy = intent.getIntExtra(INTENT_EXTRA_REQUIRED_ACCURACY, -1);
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see android.app.Service#onBind(android.content.Intent)
+ * @param arg0
+ * @return
+ * @author ricky barrette
+ */
+ @Override
+ public IBinder onBind(Intent arg0) {
+ // UNUSED
+ return null;
+ }
+
+ /**
+ *a convince method for getting an intent to start the service
+ * @param context
+ * @return a intent that will start the service
+ * @author ricky barrette
+ */
+ public static Intent getStartServiceIntent(final Context context){
+ return new Intent(context, LocationService.class);
+ }
+
+ /**
+ * a convince method for stopping the service and removing it's alarm
+ * @param context
+ * @return a runnable that will stop the service
+ * @author ricky barrette
+ */
+ public static Runnable stopService(final Context context){
+ return new Runnable(){
+ @Override
+ public void run(){
+ context.stopService(new Intent(context, LocationService.class));
+ ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).cancel(PendingIntent.getService(context, REQUEST_CODE, new Intent(context, LocationService.class), 0));
+ }
+ };
+ }
+
+ @Override
+ public void onLocationChanged(Location location) {
+ if(Debug.DEBUG)
+ Log.d(TAG, "got location +- "+ location.getAccuracy() +"m");
+ mLocation = location;
+ if(location.getAccuracy() <= (mRequiredAccuracy > -1 ? mRequiredAccuracy : Debug.MINIMUM_REQUIRED_ACCURACY) || Debug.REPORT_FIRST_LOCATION){
+ stopSelf(mStartId);
+ }
+ }
+
+ @Override
+ public void onProviderDisabled(String provider) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onProviderEnabled(String provider) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/MapView.java b/LocationLib/src/com/TwentyCodes/android/location/MapView.java
new file mode 100644
index 0000000..31c889b
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/MapView.java
@@ -0,0 +1,110 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Oct 10, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import com.TwentyCodes.android.debug.Debug;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
+
+/**
+ * We use this MapView Because it has double tap zoom capability and exception handling
+ * @author ricky barrette
+ */
+public class MapView extends com.google.android.maps.MapView {
+
+ private static final String TAG = "MapView";
+ private long mLastTouchTime;
+ private boolean mDoubleTapZoonEnabled = true;
+
+ /**
+ * @param context
+ * @param apiKey
+ * @author ricky barrette
+ */
+ public MapView(Context context, String apiKey) {
+ super(context, apiKey);
+ }
+
+ /**
+ * @param context
+ * @param attrs
+ * @author ricky barrette
+ */
+ public MapView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ /**
+ * @param context
+ * @param attrs
+ * @param defStyle
+ * @author ricky barrette
+ */
+ public MapView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
+
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+
+ long thisTime = System.currentTimeMillis();
+ if (this.mDoubleTapZoonEnabled && thisTime - mLastTouchTime < 250) {
+ // Double tap
+ this.getController().zoomInFixing((int) ev.getX(), (int) ev.getY());
+ mLastTouchTime = -1;
+ } else {
+ // Too slow
+ mLastTouchTime = thisTime;
+ }
+ }
+
+ return super.onInterceptTouchEvent(ev);
+ }
+
+ /**
+ * We will override the draw method to help prevent issues
+ * (non-Javadoc)
+ * @see android.view.View#draw(android.graphics.Canvas)
+ * @author ricky barrette
+ */
+ @Override
+ public void draw(Canvas canvas) {
+ try {
+ if(this.getZoomLevel() >= 21) {
+ this.getController().setZoom(20);
+ }
+ super.draw(canvas);
+ }
+ catch(Exception ex) {
+// getController().setCenter(this.getMapCenter());
+// getController().setZoom(this.getZoomLevel() - 2);
+ if(Debug.DEBUG)
+ Log.d(TAG, "Internal error in MapView:" + Log.getStackTraceString(ex));
+ }
+ }
+
+ /**
+ * @param isDoubleTapZoonEnabled the isDoubleTapZoonEnabled to set
+ * @author ricky barrette
+ */
+ public void setDoubleTapZoonEnabled(boolean isDoubleTapZoonEnabled) {
+ this.mDoubleTapZoonEnabled = isDoubleTapZoonEnabled;
+ }
+
+ /**
+ * @return the isDoubleTapZoonEnabled
+ * @author ricky barrette
+ */
+ public boolean getDoubleTapZoonEnabled() {
+ return mDoubleTapZoonEnabled;
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/MidPoint.java b/LocationLib/src/com/TwentyCodes/android/location/MidPoint.java
new file mode 100644
index 0000000..30510ba
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/MidPoint.java
@@ -0,0 +1,51 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Nov 30, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import com.google.android.maps.GeoPoint;
+
+/**
+ * This MidPoint object will hold the information form the calculations performed by GeoUtils.midPoint().
+ * @author ricky barrette
+ */
+public class MidPoint {
+
+ private int mMinLatitude;
+ private int mMaxLatitude;
+ private int mMinLongitude;
+ private int mMaxLongitude;
+ private GeoPoint mMidPoint;
+
+ /**
+ * Creates a new MidPoint
+ * @author ricky barrette
+ */
+ public MidPoint(GeoPoint midPoint, int minLatitude, int minLongitude, int maxLatitude, int maxLongitude) {
+ mMinLatitude = minLatitude;
+ mMaxLatitude = maxLatitude;
+ mMinLongitude = minLongitude;
+ mMaxLongitude = maxLongitude;
+ mMidPoint = midPoint;
+ }
+
+ /**
+ * zooms the provided map view to the span of this mid point
+ * @param mMapView
+ * @author ricky barrette
+ */
+ public void zoomToSpan(com.google.android.maps.MapView mMapView){
+ mMapView.getController().zoomToSpan((mMaxLatitude - mMinLatitude), (mMaxLongitude - mMinLongitude));
+ }
+
+ /**
+ * returns the calculated midpoint
+ * @return
+ * @author ricky barrette
+ */
+ public GeoPoint getMidPoint(){
+ return mMidPoint;
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java b/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java
new file mode 100644
index 0000000..2a5dbce
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/ReverseGeocoder.java
@@ -0,0 +1,149 @@
+/**
+ * ReverseGeocoder.java
+ * @date Jan 31, 2011
+ * @author ricky barrette
+ * @author Twenty Codes, LLC
+ */
+
+package com.TwentyCodes.android.location;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.location.Location;
+import android.util.Log;
+
+import com.TwentyCodes.android.debug.Debug;
+
+/**
+ * Due to this bug http://code.google.com/p/android/issues/detail?id=8816 google's Geocoder class does not function in android 2.2+.
+ * I found this source in one of the comments mentioning that it is a work around.
+ *
+ * @author ricky barrette
+ */
+public class ReverseGeocoder {
+
+ private static final String TAG = "ReverseGeocoder";
+
+ /**
+ * Performs a google maps search for the address
+ * @param location
+ * @return JSON Array on google place marks nearby
+ * @author ricky barrette
+ * @throws IOException
+ * @throws JSONException
+ */
+ public static JSONArray getFromLocation(Location location) throws IOException, JSONException {
+ String urlStr = "http://maps.google.com/maps/geo?q=" + location.getLatitude() + "," + location.getLongitude() + "&output=json&sensor=false";
+ StringBuffer response = new StringBuffer();
+ HttpClient client = new DefaultHttpClient();
+
+ if(Debug.DEBUG)
+ Log.d(TAG, urlStr);
+ HttpResponse hr = client.execute(new HttpGet(urlStr));
+ HttpEntity entity = hr.getEntity();
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
+
+ String buff = null;
+ while ((buff = br.readLine()) != null)
+ response.append(buff);
+
+ if(Debug.DEBUG)
+ Log.d(TAG, response.toString());
+
+ return new JSONObject(response.toString()).getJSONArray("Placemark");
+ }
+
+ /**
+ * Performs a google maps search for the closest address to the location
+ * @param lat
+ * @param lon
+ * @return string address, or lat, lon if search fails
+ * @author ricky barrette
+ */
+ public static String getAddressFromLocation(Location location) {
+ String urlStr = "http://maps.google.com/maps/geo?q=" + location.getLatitude() + "," + location.getLongitude() + "&output=json&sensor=false";
+ StringBuffer response = new StringBuffer();
+ HttpClient client = new DefaultHttpClient();
+
+ if(Debug.DEBUG)
+ Log.d(TAG, urlStr);
+ try {
+ HttpResponse hr = client.execute(new HttpGet(urlStr));
+ HttpEntity entity = hr.getEntity();
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
+
+ String buff = null;
+ while ((buff = br.readLine()) != null)
+ response.append(buff);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ if(Debug.DEBUG)
+ Log.d(TAG, response.toString());
+
+
+ JSONArray responseArray = null;
+ try {
+ responseArray = new JSONObject(response.toString()).getJSONArray("Placemark");
+ } catch (JSONException e) {
+ return location.getLatitude() +", "+ location.getLongitude() +" ± "+ location.getAccuracy()+"m";
+ }
+
+ if(Debug.DEBUG)
+ Log.d(TAG,responseArray.length() + " result(s)");
+
+ try {
+ JSONObject jsl = responseArray.getJSONObject(0);
+ return jsl.getString("address");
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ return location.getLatitude() +", "+ location.getLongitude() +" ± "+ location.getAccuracy()+"m";
+ }
+
+ /**
+ * Performs a google maps search for the address
+ * @param address to search
+ * @return JSON Array of google place marks
+ * @throws IOException
+ * @throws JSONException
+ * @author ricky barrette
+ */
+ public static JSONArray addressSearch(String address) throws IOException, JSONException {
+ String urlStr = "http://maps.google.com/maps/geo?q=" + address + "&output=json&sensor=false";
+ urlStr = urlStr.replace(' ', '+');
+ StringBuffer response = new StringBuffer();
+ HttpClient client = new DefaultHttpClient();
+
+ if(Debug.DEBUG)
+ Log.d(TAG, urlStr);
+ HttpResponse hr = client.execute(new HttpGet(urlStr));
+ HttpEntity entity = hr.getEntity();
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
+
+ String buff = null;
+ while ((buff = br.readLine()) != null)
+ response.append(buff);
+
+ if(Debug.DEBUG)
+ Log.d(TAG, response.toString());
+
+ return new JSONObject(response.toString()).getJSONArray("Placemark");
+ }
+}
\ No newline at end of file
diff --git a/LocationLib/src/com/TwentyCodes/android/location/UserOverlay.java b/LocationLib/src/com/TwentyCodes/android/location/UserOverlay.java
new file mode 100644
index 0000000..4b36d82
--- /dev/null
+++ b/LocationLib/src/com/TwentyCodes/android/location/UserOverlay.java
@@ -0,0 +1,351 @@
+/**
+ * @author Twenty Codes, LLC
+ * @author ricky barrette
+ * @date Dec 28, 2010
+ */
+package com.TwentyCodes.android.location;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.Paint.Style;
+import android.graphics.Point;
+import android.graphics.drawable.AnimationDrawable;
+import android.graphics.drawable.BitmapDrawable;
+import android.location.Location;
+import android.os.Handler;
+import android.os.SystemClock;
+
+import com.TwentyCodes.android.SkyHook.R;
+import com.google.android.maps.GeoPoint;
+import com.google.android.maps.MapView;
+import com.google.android.maps.MyLocationOverlay;
+import com.google.android.maps.Projection;
+
+/**
+ * This is the standard version of the UserOverlay.
+ * @author ricky barrette
+ */
+public class UserOverlay extends MyLocationOverlay {
+
+ private Context mContext;
+ private MapView mMapView;
+ private ProgressDialog mGPSprogress;
+ private boolean isFirstFix = true;
+ private GeoPointLocationListener mListener;
+ private boolean isFollowingUser = true;
+ private float myAzimuth;
+ private GeoPoint mUser;
+ private GeoPoint mDest;
+ private boolean isShowingCompass;
+ private AnimationDrawable mUserArrow;
+
+ /**
+ * Creates a new UserOverlay
+ * @param context
+ * @param mapView
+ * @author ricky barrette
+ */
+ public UserOverlay(Context context, MapView mapView) {
+ super(context, mapView);
+ mMapView = mapView;
+ mContext = context;
+ mUserArrow = (AnimationDrawable) mContext.getResources().getAnimation(R.drawable.userarrow);
+ mUserArrow.start();
+ }
+
+ /**
+ * disables the compass view
+ * (non-Javadoc)
+ * @see com.google.android.maps.MyLocationOverlay#disableCompass()
+ * @author ricky barrette
+ */
+ @Override
+ public void disableCompass(){
+ isShowingCompass = false;
+ }
+
+ /**
+ * called when the overlay is disabled. this will disable all progress dialogs, and location based servicess
+ * (non-Javadoc)
+ * @see com.google.android.maps.MyLocationOverlay#disableMyLocation()
+ * @author ricky barrette
+ */
+ @Override
+ public void disableMyLocation(){
+ super.disableCompass();
+ super.disableMyLocation();
+ mGPSprogress.dismiss();
+ }
+
+
+ /**
+ * draws an accuracy circle onto the canvas supplied
+ * @param center point of the circle
+ * @param left point of the circle
+ * @param canvas to be drawn on
+ * @return modified canvas
+ * @author ricky barrette
+ */
+ private Canvas drawAccuracyCircle(Point center, Point left, Canvas canvas) {
+ Paint paint = new Paint();
+
+ /*
+ * get radius of the circle being drawn by
+ */
+ int circleRadius = center.x - left.x;
+ if(circleRadius <= 0){
+ circleRadius = left.x - center.x;
+ }
+ /*
+ * paint a blue circle on the map
+ */
+ paint.setAntiAlias(true);
+ paint.setStrokeWidth(2.0f);
+ paint.setColor(Color.BLUE);
+ paint.setStyle(Style.STROKE);
+ canvas.drawCircle(center.x, center.y, circleRadius, paint);
+ /*
+ * fill the radius with a alpha blue
+ */
+ paint.setAlpha(30);
+ paint.setStyle(Style.FILL);
+ canvas.drawCircle(center.x, center.y, circleRadius, paint);
+
+ /*
+ * for testing
+ * draw a dot over the left geopoint
+ */
+// paint.setColor(Color.RED);
+// RectF oval = new RectF(left.x - 1, left.y - 1, left.x + 1, left.y + 1);
+// canvas.drawOval(oval, paint);
+
+ return canvas;
+ }
+
+ /**
+ * computes bearing to geopoint based on device oriantaion and draws the compass of what you want really really badly on screen
+ * @param - canvas - the canvas to draw on
+ * @param - bearing - bearing of user based on magnetic compass
+ * @author ricky barrette
+ */
+ @Override
+ protected void drawCompass(Canvas canvas, float bearing){
+ myAzimuth = bearing;
+
+ mMapView.invalidate();
+
+ if (isShowingCompass) {
+ /*
+ * if the dest and user geopoint are not null, then draw the compass point to the dest geopoint
+ *
+ * else draw the compass to point north
+ */
+ if (mUser != null && mDest != null){
+ Double d = GeoUtils.bearing(mUser, mDest);
+ bearing = bearing - d.floatValue();
+ } else if (bearing != 0){
+ bearing = 360 - bearing;
+ }
+
+ super.drawCompass(canvas, bearing);
+ }
+ }
+
+ /**
+ * we override this methods so we can provide a drawable and a location to draw on the canvas.
+ * (non-Javadoc)
+ * @see com.google.android.maps.Overlay#draw(android.graphics.Canvas, com.google.android.maps.MapView, boolean)
+ * @param canvas
+ * @param mapView
+ * @param shadow
+ * @author ricky barrette
+ */
+ @Override
+ protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint point, long when){
+ if (point != null) {
+
+ Point center = new Point();
+ Point left = new Point();
+ Projection projection = mapView.getProjection();
+ GeoPoint leftGeo = GeoUtils.distanceFrom(point, lastFix.getAccuracy());
+ projection.toPixels(leftGeo, left);
+ projection.toPixels(point, center);
+ canvas = drawAccuracyCircle(center, left, canvas);
+ canvas = drawUser(center, myAzimuth, canvas);
+ /*
+ * the following log is used to demonstrate if the leftGeo point is the correct
+ */
+// Log.d(SkyHook.TAG, (GeoUtils.distanceKm(mPoint, leftGeo) * 1000)+"m");
+ }
+ }
+
+ /**
+ * draws user arrow that points north based on bearing onto the supplied canvas
+ * @param point to draw user arrow on
+ * @param bearing of the device
+ * @param canvas to draw on
+ * @return modified canvas
+ * @author ricky barrette
+ */
+ private Canvas drawUser(Point point, float bearing, Canvas canvas){
+ Bitmap arrowBitmap = ((BitmapDrawable)mUserArrow.getCurrent()).getBitmap();
+ Matrix matrix = new Matrix();
+ matrix.postRotate(bearing);
+ Bitmap rotatedBmp = Bitmap.createBitmap(
+ arrowBitmap,
+ 0, 0,
+ arrowBitmap.getWidth(),
+ arrowBitmap.getHeight(),
+ matrix,
+ true
+ );
+ canvas.drawBitmap(
+ rotatedBmp,
+ point.x - (rotatedBmp.getWidth() / 2),
+ point.y - (rotatedBmp.getHeight() / 2),
+ null
+ );
+ return canvas;
+ }
+
+ /**
+ * enables the compass view
+ * (non-Javadoc)
+ * @see com.google.android.maps.MyLocationOverlay#enableCompass()
+ * @author ricky barrette
+ */
+ @Override
+ public boolean enableCompass(){
+ isShowingCompass = true;
+ return isShowingCompass;
+ }
+
+ /**
+ * called when the user overlay is enabled, this will display the progress dialog
+ * (non-Javadoc)
+ * @see com.google.android.maps.MyLocationOverlay#enableMyLocation()
+ * @author ricky barrette
+ */
+ @Override
+ public boolean enableMyLocation(){
+ mGPSprogress = ProgressDialog.show(mContext, "", mContext.getText(R.string.gps_fix), true, true);
+ isFirstFix = true;
+ super.enableCompass();
+
+ /**
+ * this is a message that tells the user that we are having trouble getting an GPS signal
+ */
+ new Handler().postAtTime(new Runnable() {
+ @Override
+ public void run() {
+ if (mGPSprogress.isShowing()) {
+ mGPSprogress.cancel();
+ AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
+ builder.setMessage(
+ mContext.getText(R.string.sorry_theres_trouble))
+ .setCancelable(false)
+ .setPositiveButton(mContext.getText(android.R.string.ok),
+ new DialogInterface.OnClickListener() {
+ public void onClick( DialogInterface dialog, int id) {
+ dialog.cancel();
+ }
+ });
+ builder.show();
+ }
+ }
+ }, SystemClock.uptimeMillis()+90000L);
+
+ return super.enableMyLocation();
+ }
+
+ /**
+ * Allows the map to follow the user
+ * @param followUser
+ * @author ricky barrette
+ */
+ public void followUser(boolean followUser){
+ isFollowingUser = followUser;
+ }
+
+ /**
+ * called when the SkyHook location changes, this method is resposiable for updating the overlay location and accuracy circle.
+ * (non-Javadoc)
+ * @see com.TwentyCodes.android.SkyHook.GeoPointLocationListener.location.LocationListener#onLocationChanged(com.google.android.maps.GeoPoint, float)
+ * @param point
+ * @param accuracy
+ * @author ricky barrette
+ */
+ @Override
+ public void onLocationChanged(Location location) {
+
+ GeoPoint point = new GeoPoint((int) (location.getLatitude() *1e6), (int) (location.getLongitude() *1e6));
+
+ /*
+ * if this is the first fix
+ * set map center the users location, and zoom to the max zoom level
+ */
+ if(point != null && isFirstFix){
+ mMapView.getController().setCenter(point);
+ mMapView.getController().setZoom(mMapView.getMaxZoomLevel()+3);
+ mGPSprogress.dismiss();
+ isFirstFix = false;
+ }
+
+ //pan to user if off map
+ if (isFollowingUser) {
+ panToUserIfOffMap(point);
+ }
+
+ mListener.onLocationChanged(point, (int) location.getAccuracy());
+ super.onLocationChanged(location);
+ }
+
+ /**
+ * pans the map view if the user is off screen.
+ * @author ricky barrette
+ */
+ private void panToUserIfOffMap(GeoPoint user) {
+ GeoPoint center = mMapView.getMapCenter();
+ double distance = GeoUtils.distanceKm(center, user);
+ double distanceLat = GeoUtils.distanceKm(center, new GeoPoint((center.getLatitudeE6() + (int) (mMapView.getLatitudeSpan() / 2)), center.getLongitudeE6()));
+ double distanceLon = GeoUtils.distanceKm(center, new GeoPoint(center.getLatitudeE6(), (center.getLongitudeE6() + (int) (mMapView.getLongitudeSpan() / 2))));
+
+ double whichIsGreater = (distanceLat > distanceLon) ? distanceLat : distanceLon;
+
+ /**
+ * if the user is one the map, keep them their
+ * else don't pan to user unless they pan pack to them
+ */
+ if( ! (distance > whichIsGreater) )
+ if (distance > distanceLat || distance > distanceLon){
+ mMapView.getController().animateTo(user);
+ }
+ }
+
+ /**
+ * Attempts to register the listener for location updates
+ * @param listener
+ * @author Ricky Barrette
+ */
+ public void registerListener(GeoPointLocationListener listener){
+ if (mListener == null){
+ mListener = listener;
+ }
+ }
+
+ /**
+ * UnResgisters the listener. after this call you will no longer get location updates
+ * @author Ricky Barrette
+ */
+ public void unRegisterListener(){
+ mListener = null;
+ }
+
+}
\ No newline at end of file