diff --git a/GreenTravel/.classpath b/GreenTravel/.classpath
new file mode 100644
index 00000000..6c635c01
--- /dev/null
+++ b/GreenTravel/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/GreenTravel/.project b/GreenTravel/.project
new file mode 100644
index 00000000..d7b9f558
--- /dev/null
+++ b/GreenTravel/.project
@@ -0,0 +1,33 @@
+
+
+ GreenTravel
+
+
+
+
+
+ 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/GreenTravel/.settings/org.eclipse.jdt.core.prefs b/GreenTravel/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..1100dd87
--- /dev/null
+++ b/GreenTravel/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+#Mon Feb 14 17:21:14 UTC 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/GreenTravel/AndroidManifest.xml b/GreenTravel/AndroidManifest.xml
new file mode 100644
index 00000000..549eded6
--- /dev/null
+++ b/GreenTravel/AndroidManifest.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Coordinate.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Coordinate.class
new file mode 100644
index 00000000..3b0a086c
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Coordinate.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity$1.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity$1.class
new file mode 100644
index 00000000..e9f5ed27
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity$1.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity.class
new file mode 100644
index 00000000..4fa6cc52
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/EndTripActivity.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService$LocalBinder.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService$LocalBinder.class
new file mode 100644
index 00000000..6634d2b3
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService$LocalBinder.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService.class
new file mode 100644
index 00000000..edc2a875
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/GreenTravelService.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash$1.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash$1.class
new file mode 100644
index 00000000..73798caa
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash$1.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash.class
new file mode 100644
index 00000000..f2b3d01d
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/MainSplash.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$attr.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$attr.class
new file mode 100644
index 00000000..0423109b
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$attr.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$color.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$color.class
new file mode 100644
index 00000000..dfee6739
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$color.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$drawable.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$drawable.class
new file mode 100644
index 00000000..7153c82d
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$drawable.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$id.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$id.class
new file mode 100644
index 00000000..22d9c54c
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$id.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$layout.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$layout.class
new file mode 100644
index 00000000..6219d4fe
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$layout.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$string.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$string.class
new file mode 100644
index 00000000..e441a116
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$string.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$style.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$style.class
new file mode 100644
index 00000000..db015269
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R$style.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R.class
new file mode 100644
index 00000000..4035c5af
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/R.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$1.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$1.class
new file mode 100644
index 00000000..b6d21edc
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$1.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$2.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$2.class
new file mode 100644
index 00000000..61d93ddb
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1$2.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1.class
new file mode 100644
index 00000000..dae72c13
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen1.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$1.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$1.class
new file mode 100644
index 00000000..886f5c49
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$1.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$2.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$2.class
new file mode 100644
index 00000000..ad71eee2
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4$2.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4.class
new file mode 100644
index 00000000..0f3204c6
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen4.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen5.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen5.class
new file mode 100644
index 00000000..79a1ce9e
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen5.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen7.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen7.class
new file mode 100644
index 00000000..efcc789e
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/Screen7.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/SettingsActivity.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/SettingsActivity.class
new file mode 100644
index 00000000..69fff086
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/SettingsActivity.class differ
diff --git a/GreenTravel/bin/classes/org/commoditysoftware/greentravel/StartTrip.class b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/StartTrip.class
new file mode 100644
index 00000000..da96018e
Binary files /dev/null and b/GreenTravel/bin/classes/org/commoditysoftware/greentravel/StartTrip.class differ
diff --git a/GreenTravel/bin/res/drawable-hdpi/icon.png b/GreenTravel/bin/res/drawable-hdpi/icon.png
new file mode 100644
index 00000000..882eb148
Binary files /dev/null and b/GreenTravel/bin/res/drawable-hdpi/icon.png differ
diff --git a/GreenTravel/bin/res/drawable-ldpi/icon.png b/GreenTravel/bin/res/drawable-ldpi/icon.png
new file mode 100644
index 00000000..18689f65
Binary files /dev/null and b/GreenTravel/bin/res/drawable-ldpi/icon.png differ
diff --git a/GreenTravel/bin/res/drawable-mdpi/icon.png b/GreenTravel/bin/res/drawable-mdpi/icon.png
new file mode 100644
index 00000000..02e96b96
Binary files /dev/null and b/GreenTravel/bin/res/drawable-mdpi/icon.png differ
diff --git a/GreenTravel/bin/res/drawable/greendriving_for_android.png b/GreenTravel/bin/res/drawable/greendriving_for_android.png
new file mode 100644
index 00000000..9c686358
Binary files /dev/null and b/GreenTravel/bin/res/drawable/greendriving_for_android.png differ
diff --git a/GreenTravel/bin/res/drawable/greendriving_settings.png b/GreenTravel/bin/res/drawable/greendriving_settings.png
new file mode 100644
index 00000000..7729b0ed
Binary files /dev/null and b/GreenTravel/bin/res/drawable/greendriving_settings.png differ
diff --git a/GreenTravel/bin/res/drawable/greendriving_tripcalc.png b/GreenTravel/bin/res/drawable/greendriving_tripcalc.png
new file mode 100644
index 00000000..0be21135
Binary files /dev/null and b/GreenTravel/bin/res/drawable/greendriving_tripcalc.png differ
diff --git a/GreenTravel/bin/res/drawable/ic_menu_end.png b/GreenTravel/bin/res/drawable/ic_menu_end.png
new file mode 100644
index 00000000..f48b99e1
Binary files /dev/null and b/GreenTravel/bin/res/drawable/ic_menu_end.png differ
diff --git a/GreenTravel/bin/res/drawable/ic_menu_pause.png b/GreenTravel/bin/res/drawable/ic_menu_pause.png
new file mode 100644
index 00000000..83e2dd3e
Binary files /dev/null and b/GreenTravel/bin/res/drawable/ic_menu_pause.png differ
diff --git a/GreenTravel/bin/res/drawable/ic_menu_resume.png b/GreenTravel/bin/res/drawable/ic_menu_resume.png
new file mode 100644
index 00000000..21af992c
Binary files /dev/null and b/GreenTravel/bin/res/drawable/ic_menu_resume.png differ
diff --git a/GreenTravel/bin/res/drawable/ic_menu_settings.png b/GreenTravel/bin/res/drawable/ic_menu_settings.png
new file mode 100644
index 00000000..fa158438
Binary files /dev/null and b/GreenTravel/bin/res/drawable/ic_menu_settings.png differ
diff --git a/GreenTravel/bin/res/drawable/ic_menu_start.png b/GreenTravel/bin/res/drawable/ic_menu_start.png
new file mode 100644
index 00000000..d54e3ad1
Binary files /dev/null and b/GreenTravel/bin/res/drawable/ic_menu_start.png differ
diff --git a/GreenTravel/bin/res/drawable/icon.png b/GreenTravel/bin/res/drawable/icon.png
new file mode 100644
index 00000000..4683da62
Binary files /dev/null and b/GreenTravel/bin/res/drawable/icon.png differ
diff --git a/GreenTravel/bin/res/drawable/logo.png b/GreenTravel/bin/res/drawable/logo.png
new file mode 100644
index 00000000..3e24adc0
Binary files /dev/null and b/GreenTravel/bin/res/drawable/logo.png differ
diff --git a/GreenTravel/gen/org/commoditysoftware/greentravel/R.java b/GreenTravel/gen/org/commoditysoftware/greentravel/R.java
new file mode 100644
index 00000000..a6938e4f
--- /dev/null
+++ b/GreenTravel/gen/org/commoditysoftware/greentravel/R.java
@@ -0,0 +1,89 @@
+/* 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 org.commoditysoftware.greentravel;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class color {
+ public static final int black=0x7f040004;
+ public static final int darker_gray=0x7f040000;
+ public static final int green=0x7f040003;
+ /** Retrieved via Resources.getColor() and friends.
+ */
+ public static final int red=0x7f040002;
+ public static final int semitrans_gray=0x7f040001;
+ }
+ public static final class drawable {
+ public static final int greendriving_for_android=0x7f020000;
+ public static final int greendriving_settings=0x7f020001;
+ public static final int greendriving_tripcalc=0x7f020002;
+ public static final int ic_menu_end=0x7f020003;
+ public static final int ic_menu_pause=0x7f020004;
+ public static final int ic_menu_resume=0x7f020005;
+ public static final int ic_menu_settings=0x7f020006;
+ public static final int ic_menu_start=0x7f020007;
+ public static final int icon=0x7f020008;
+ public static final int logo=0x7f020009;
+ }
+ public static final class id {
+ public static final int Chronometer01=0x7f070014;
+ public static final int TextView01=0x7f070003;
+ public static final int TextView02=0x7f070009;
+ public static final int TextView03=0x7f07001f;
+ public static final int chrono_text=0x7f070013;
+ public static final int co2=0x7f070005;
+ public static final int co2_label=0x7f070004;
+ public static final int delt_text=0x7f07001a;
+ public static final int distance=0x7f07001c;
+ public static final int distance_label=0x7f07001b;
+ public static final int doStuff=0x7f070006;
+ public static final int donateNow=0x7f07000c;
+ public static final int done=0x7f070011;
+ public static final int gps_text=0x7f070015;
+ public static final int latitude=0x7f070017;
+ public static final int latitude_label=0x7f070016;
+ public static final int learnMore=0x7f070008;
+ public static final int longitude=0x7f070019;
+ public static final int longituede_label=0x7f070018;
+ public static final int proceedToTrip=0x7f07000a;
+ public static final int results_layout=0x7f070002;
+ public static final int screen1_layout=0x7f070007;
+ public static final int screen4_layout=0x7f07000b;
+ public static final int screen5_layout=0x7f07000e;
+ public static final int screen7_layout=0x7f07000f;
+ public static final int settings_layout=0x7f070010;
+ public static final int speec_label=0x7f07001d;
+ public static final int splash_screen_layout=0x7f070000;
+ public static final int start_trip_layout=0x7f070012;
+ public static final int velocity=0x7f07001e;
+ public static final int version=0x7f070001;
+ public static final int whoYouIs=0x7f07000d;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ public static final int results=0x7f030001;
+ public static final int screen1=0x7f030002;
+ public static final int screen4=0x7f030003;
+ public static final int screen5=0x7f030004;
+ public static final int screen7=0x7f030005;
+ public static final int settings=0x7f030006;
+ public static final int start_trip=0x7f030007;
+ }
+ public static final class string {
+ public static final int app_name=0x7f050001;
+ public static final int hello=0x7f050000;
+ public static final int learn_more=0x7f050002;
+ public static final int proceed=0x7f050003;
+ }
+ public static final class style {
+ public static final int ActionButton=0x7f060000;
+ public static final int TextAppearance=0x7f060001;
+ public static final int TextAppearance_ActionButton=0x7f060002;
+ }
+}
diff --git a/GreenTravel/lint.xml b/GreenTravel/lint.xml
new file mode 100644
index 00000000..ee0eead5
--- /dev/null
+++ b/GreenTravel/lint.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/GreenTravel/project.properties b/GreenTravel/project.properties
new file mode 100644
index 00000000..797fb4fc
--- /dev/null
+++ b/GreenTravel/project.properties
@@ -0,0 +1,13 @@
+# 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.
+
+# Indicates whether an apk should be generated for each density.
+split.density=false
+# Project target.
+target=android-7
diff --git a/GreenTravel/res/drawable-hdpi/icon.png b/GreenTravel/res/drawable-hdpi/icon.png
new file mode 100644
index 00000000..8074c4c5
Binary files /dev/null and b/GreenTravel/res/drawable-hdpi/icon.png differ
diff --git a/GreenTravel/res/drawable-ldpi/icon.png b/GreenTravel/res/drawable-ldpi/icon.png
new file mode 100644
index 00000000..1095584e
Binary files /dev/null and b/GreenTravel/res/drawable-ldpi/icon.png differ
diff --git a/GreenTravel/res/drawable-mdpi/icon.png b/GreenTravel/res/drawable-mdpi/icon.png
new file mode 100644
index 00000000..a07c69fa
Binary files /dev/null and b/GreenTravel/res/drawable-mdpi/icon.png differ
diff --git a/GreenTravel/res/drawable/greendriving_for_android.png b/GreenTravel/res/drawable/greendriving_for_android.png
new file mode 100644
index 00000000..16e09088
Binary files /dev/null and b/GreenTravel/res/drawable/greendriving_for_android.png differ
diff --git a/GreenTravel/res/drawable/greendriving_settings.png b/GreenTravel/res/drawable/greendriving_settings.png
new file mode 100644
index 00000000..3f0d7a52
Binary files /dev/null and b/GreenTravel/res/drawable/greendriving_settings.png differ
diff --git a/GreenTravel/res/drawable/greendriving_tripcalc.png b/GreenTravel/res/drawable/greendriving_tripcalc.png
new file mode 100644
index 00000000..d1b562f6
Binary files /dev/null and b/GreenTravel/res/drawable/greendriving_tripcalc.png differ
diff --git a/GreenTravel/res/drawable/ic_menu_end.png b/GreenTravel/res/drawable/ic_menu_end.png
new file mode 100644
index 00000000..f69613e7
Binary files /dev/null and b/GreenTravel/res/drawable/ic_menu_end.png differ
diff --git a/GreenTravel/res/drawable/ic_menu_pause.png b/GreenTravel/res/drawable/ic_menu_pause.png
new file mode 100644
index 00000000..b03e7ab3
Binary files /dev/null and b/GreenTravel/res/drawable/ic_menu_pause.png differ
diff --git a/GreenTravel/res/drawable/ic_menu_resume.png b/GreenTravel/res/drawable/ic_menu_resume.png
new file mode 100644
index 00000000..0bd0f539
Binary files /dev/null and b/GreenTravel/res/drawable/ic_menu_resume.png differ
diff --git a/GreenTravel/res/drawable/ic_menu_settings.png b/GreenTravel/res/drawable/ic_menu_settings.png
new file mode 100644
index 00000000..e8779a97
Binary files /dev/null and b/GreenTravel/res/drawable/ic_menu_settings.png differ
diff --git a/GreenTravel/res/drawable/ic_menu_start.png b/GreenTravel/res/drawable/ic_menu_start.png
new file mode 100644
index 00000000..65cea0ab
Binary files /dev/null and b/GreenTravel/res/drawable/ic_menu_start.png differ
diff --git a/GreenTravel/res/drawable/icon.png b/GreenTravel/res/drawable/icon.png
new file mode 100644
index 00000000..5a382fc4
Binary files /dev/null and b/GreenTravel/res/drawable/icon.png differ
diff --git a/GreenTravel/res/drawable/logo.png b/GreenTravel/res/drawable/logo.png
new file mode 100644
index 00000000..1798451c
Binary files /dev/null and b/GreenTravel/res/drawable/logo.png differ
diff --git a/GreenTravel/res/layout/main.xml b/GreenTravel/res/layout/main.xml
new file mode 100644
index 00000000..f2ea079c
--- /dev/null
+++ b/GreenTravel/res/layout/main.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/results.xml b/GreenTravel/res/layout/results.xml
new file mode 100644
index 00000000..aa113ee3
--- /dev/null
+++ b/GreenTravel/res/layout/results.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/screen1.xml b/GreenTravel/res/layout/screen1.xml
new file mode 100644
index 00000000..036c4124
--- /dev/null
+++ b/GreenTravel/res/layout/screen1.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/screen4.xml b/GreenTravel/res/layout/screen4.xml
new file mode 100644
index 00000000..09ea461b
--- /dev/null
+++ b/GreenTravel/res/layout/screen4.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/screen5.xml b/GreenTravel/res/layout/screen5.xml
new file mode 100644
index 00000000..29336849
--- /dev/null
+++ b/GreenTravel/res/layout/screen5.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/screen7.xml b/GreenTravel/res/layout/screen7.xml
new file mode 100644
index 00000000..1d451451
--- /dev/null
+++ b/GreenTravel/res/layout/screen7.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/settings.xml b/GreenTravel/res/layout/settings.xml
new file mode 100644
index 00000000..b630f073
--- /dev/null
+++ b/GreenTravel/res/layout/settings.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/layout/start_trip.xml b/GreenTravel/res/layout/start_trip.xml
new file mode 100644
index 00000000..118dfb70
--- /dev/null
+++ b/GreenTravel/res/layout/start_trip.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/res/values/colors.xml b/GreenTravel/res/values/colors.xml
new file mode 100644
index 00000000..dccc456a
--- /dev/null
+++ b/GreenTravel/res/values/colors.xml
@@ -0,0 +1,9 @@
+
+
+ #5A5A5A
+ #99222222
+
+ #f00
+ #387C44
+ #000000
+
\ No newline at end of file
diff --git a/GreenTravel/res/values/strings.xml b/GreenTravel/res/values/strings.xml
new file mode 100644
index 00000000..f71213b4
--- /dev/null
+++ b/GreenTravel/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+
+ Hello World, MainSplash!
+ GreenTravel
+ Learn More...
+ Proceed...
+
diff --git a/GreenTravel/res/values/styles.xml b/GreenTravel/res/values/styles.xml
new file mode 100644
index 00000000..72428ef0
--- /dev/null
+++ b/GreenTravel/res/values/styles.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/Coordinate.java b/GreenTravel/src/org/commoditysoftware/greentravel/Coordinate.java
new file mode 100644
index 00000000..20ff779b
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/Coordinate.java
@@ -0,0 +1,241 @@
+package org.commoditysoftware.greentravel ;
+
+import android.util.FloatMath;
+import android.util.Log;
+
+
+/**
+ * Class for handling coordinates
+ *
+ * @author Linus Helgesson
+ *
+ */
+public class Coordinate {
+ private float mLongitude = 0;
+ private float mLatitude = 0;
+ private float[] mResults = new float[2];
+
+ /**
+ * Empty constructor
+ */
+ public Coordinate () {
+
+ }
+
+ /**
+ * Constructor taking a longitude and a latitude
+ *
+ * @param longitude
+ * @param latitude
+ */
+ public Coordinate(float longitude, float latitude) {
+ this.mLongitude = longitude;
+ this.mLatitude = latitude;
+ }
+
+ /**
+ * Get the longitude part of this coordinate
+ *
+ * @return The longitude part of this coordinate
+ */
+ public float getLongitude() {
+ return mLongitude;
+ }
+
+ /**
+ * Set the longitude part of this coordinate
+ *
+ * @param longitude The longitude part of this coordinate
+ */
+ public void setLongitude(float longitude) {
+ this.mLongitude = longitude;
+ }
+
+ /**
+ * Get the latitude part of this coordinate
+ *
+ * @return The latitude part of this coordinate
+ */
+ public float getLatitude() {
+ return mLatitude;
+ }
+
+ /**
+ * Set the latitude part of this coordinate
+ *
+ * @param latitude The latitude part of this coordinate
+ */
+ public void setLatitude(float latitude) {
+ this.mLatitude = latitude;
+ }
+
+ private static final float PI_OVER_180 = 0.017453292519943295769236907684886f;
+
+ // Earth medium radius, should maybe be changed to swedish latitude
+ private static final float EARTH_RADIUS = 6371009;
+
+ /**
+ * Calculates a bounding box of a certain size arund a coordinate. This is mainly used for a quick check
+ * in the database for cameras that are close to a coordinate. This function takes a size ion meters as
+ * a parameter and returns an array of two Coordinate objects. The first Coordinate is the upper left corner
+ * while the last coordinate is the bottom right corner.
+ *
+ * @param side The length of the square side in meters
+ *
+ * @return Two cordinates where the first is smaller than the second.
+ */
+ public Coordinate[] getBoundingBox(float side) {
+
+ Coordinate[] ret = new Coordinate[2];
+
+ float degLatM = 110574.235f;
+ float degLongM = 110572.833f * FloatMath.cos(mLatitude * PI_OVER_180);
+ float deltaLat = side / degLatM;
+ float deltaLong = side / degLongM;
+
+ ret[0] = new Coordinate(getLongitude() - deltaLong, getLatitude() - deltaLat);
+ ret[1] = new Coordinate(getLongitude() + deltaLong, getLatitude() + deltaLat);
+
+ return ret;
+ }
+
+ /**
+ * Calculates the distance between two Coordinate objects using the Spherical law of cosines found at:
+ *
+ * http://www.movable-type.co.uk/scripts/latlong.html
+ *
+ * @param coordinate The coordinate to measure the distance to.
+ * @return the distance in meters
+ */
+ /*
+ public float distanceTo(Coordinate coordinate) {
+ float lat1 = mLatitude * PI_OVER_180;
+ float lat2 = coordinate.getLatitude() * PI_OVER_180;
+ float dLat = (coordinate.getLatitude() - mLatitude) * PI_OVER_180;
+ float dLong = (coordinate.getLongitude() - mLongitude) * PI_OVER_180;
+
+ float a = FloatMath.sin(dLat/2) * FloatMath.sin(dLat/2) +
+ FloatMath.cos(lat1) * FloatMath.cos(lat2) *
+ FloatMath.sin(dLong/2) * FloatMath.sin(dLong/2);
+
+ return (float)(EARTH_RADIUS * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)));
+ }
+ public float distanceTo(Coordinate coordinate) {
+ float lat1 = mLatitude*PI_OVER_180;
+ float lat2 = coordinate.getLatitude() * PI_OVER_180;
+ float long1 = mLongitude * PI_OVER_180;
+ float long2 = coordinate.getLongitude() * PI_OVER_180;
+
+ return (float)Math.acos(FloatMath.sin(lat1) * FloatMath.sin(lat2) + FloatMath.cos(lat1) * FloatMath.cos(lat2) * FloatMath.cos(long2-long1)) * EARTH_RADIUS;
+ }
+ */
+
+ public float distanceTo(Coordinate dest) {
+ // See if we already have the result
+ computeDistanceAndBearing(mLatitude, mLongitude,
+ dest.getLatitude(), dest.getLongitude(), mResults);
+
+ return mResults[0];
+ }
+
+ private static void computeDistanceAndBearing(double lat1, double lon1,
+ double lat2, double lon2, float[] results) {
+ // Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
+ // using the "Inverse Formula" (section 4)
+
+ int MAXITERS = 20;
+ // Convert lat/long to radians
+ lat1 *= Math.PI / 180.0;
+ lat2 *= Math.PI / 180.0;
+ lon1 *= Math.PI / 180.0;
+ lon2 *= Math.PI / 180.0;
+
+ double a = 6378137.0; // WGS84 major axis
+ double b = 6356752.3142; // WGS84 semi-major axis
+ double f = (a - b) / a;
+ double aSqMinusBSqOverBSq = (a * a - b * b) / (b * b);
+
+ double L = lon2 - lon1;
+ double A = 0.0;
+ double U1 = Math.atan((1.0 - f) * Math.tan(lat1));
+ double U2 = Math.atan((1.0 - f) * Math.tan(lat2));
+
+ double cosU1 = Math.cos(U1);
+ double cosU2 = Math.cos(U2);
+ double sinU1 = Math.sin(U1);
+ double sinU2 = Math.sin(U2);
+ double cosU1cosU2 = cosU1 * cosU2;
+ double sinU1sinU2 = sinU1 * sinU2;
+
+ double sigma = 0.0;
+ double deltaSigma = 0.0;
+ double cosSqAlpha = 0.0;
+ double cos2SM = 0.0;
+ double cosSigma = 0.0;
+ double sinSigma = 0.0;
+ double cosLambda = 0.0;
+ double sinLambda = 0.0;
+
+ double lambda = L; // initial guess
+ for (int iter = 0; iter < MAXITERS; iter++) {
+ double lambdaOrig = lambda;
+ cosLambda = Math.cos(lambda);
+ sinLambda = Math.sin(lambda);
+ double t1 = cosU2 * sinLambda;
+ double t2 = cosU1 * sinU2 - sinU1 * cosU2 * cosLambda;
+ double sinSqSigma = t1 * t1 + t2 * t2; // (14)
+ sinSigma = Math.sqrt(sinSqSigma);
+ cosSigma = sinU1sinU2 + cosU1cosU2 * cosLambda; // (15)
+ sigma = Math.atan2(sinSigma, cosSigma); // (16)
+ double sinAlpha = (sinSigma == 0) ? 0.0 :
+ cosU1cosU2 * sinLambda / sinSigma; // (17)
+ cosSqAlpha = 1.0 - sinAlpha * sinAlpha;
+ cos2SM = (cosSqAlpha == 0) ? 0.0 :
+ cosSigma - 2.0 * sinU1sinU2 / cosSqAlpha; // (18)
+
+ double uSquared = cosSqAlpha * aSqMinusBSqOverBSq; // defn
+ A = 1 + (uSquared / 16384.0) * // (3)
+ (4096.0 + uSquared *
+ (-768 + uSquared * (320.0 - 175.0 * uSquared)));
+ double B = (uSquared / 1024.0) * // (4)
+ (256.0 + uSquared *
+ (-128.0 + uSquared * (74.0 - 47.0 * uSquared)));
+ double C = (f / 16.0) *
+ cosSqAlpha *
+ (4.0 + f * (4.0 - 3.0 * cosSqAlpha)); // (10)
+ double cos2SMSq = cos2SM * cos2SM;
+ deltaSigma = B * sinSigma * // (6)
+ (cos2SM + (B / 4.0) *
+ (cosSigma * (-1.0 + 2.0 * cos2SMSq) -
+ (B / 6.0) * cos2SM *
+ (-3.0 + 4.0 * sinSigma * sinSigma) *
+ (-3.0 + 4.0 * cos2SMSq)));
+
+ lambda = L +
+ (1.0 - C) * f * sinAlpha *
+ (sigma + C * sinSigma *
+ (cos2SM + C * cosSigma *
+ (-1.0 + 2.0 * cos2SM * cos2SM))); // (11)
+
+ double delta = (lambda - lambdaOrig) / lambda;
+ if (Math.abs(delta) < 1.0e-12) {
+ break;
+ }
+ }
+
+ float distance = (float) (b * A * (sigma - deltaSigma));
+ results[0] = distance;
+ if (results.length > 1) {
+ float initialBearing = (float) Math.atan2(cosU2 * sinLambda,
+ cosU1 * sinU2 - sinU1 * cosU2 * cosLambda);
+ initialBearing *= 180.0 / Math.PI;
+ results[1] = initialBearing;
+ if (results.length > 2) {
+ float finalBearing = (float) Math.atan2(cosU1 * sinLambda,
+ -sinU1 * cosU2 + cosU1 * sinU2 * cosLambda);
+ finalBearing *= 180.0 / Math.PI;
+ results[2] = finalBearing;
+ }
+ }
+ }
+}
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/EndTripActivity.java b/GreenTravel/src/org/commoditysoftware/greentravel/EndTripActivity.java
new file mode 100644
index 00000000..47ffa63a
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/EndTripActivity.java
@@ -0,0 +1,40 @@
+package org.commoditysoftware.greentravel;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+
+public class EndTripActivity extends Activity {
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.results);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.results_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Carbon burden of this trip: ");
+
+ ((TextView) findViewById(R.id.co2)).
+ setText(GreenTravelService.co2Produced());
+ // Hook up button presses to the appropriate event handler.
+ ((Button) findViewById(R.id.doStuff)).setOnClickListener(mDo);
+ }
+
+ /**
+ * A call-back for when the user presses the Do Something button.
+ */
+ OnClickListener mDo = new OnClickListener() {
+ public void onClick(View v) {
+ startActivity(new Intent(EndTripActivity.this, Screen4.class));
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ startActivity(i);
+ }
+ };
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/GreenTravelService.java b/GreenTravel/src/org/commoditysoftware/greentravel/GreenTravelService.java
new file mode 100644
index 00000000..3dd5da78
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/GreenTravelService.java
@@ -0,0 +1,157 @@
+package org.commoditysoftware.greentravel ;
+
+import android.util.Log;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.Bundle;
+import java.util.ArrayList;
+import android.content.Context;
+import android.app.Notification;
+import android.location.Criteria;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+
+public class GreenTravelService extends Service implements LocationListener {
+
+ public static Coordinate startPoint;
+ public static double distance;
+ public static double co2Rate = 0.66666;
+
+ private static StartTrip TRIP_HOME;
+ private static final boolean debug = true;
+ private LocationManager mLocationManager;
+ private long lCurrTime = 0, lLastTime = 0;
+ private static Location mLoc = new Location("");
+ private static float mSpeed = 0;
+
+ ArrayList mClients = new ArrayList();
+
+ public static String co2Produced() {
+ String result = "";
+
+ result += (distance * 0.6214) * co2Rate;
+
+ return result;
+ }
+
+ public static Location getLocation() {
+ return mLoc;
+ }
+
+ public static float getSpeed() {
+ return mSpeed;
+ }
+
+ public class LocalBinder extends Binder {
+ GreenTravelService getService() {
+ return GreenTravelService.this;
+ }
+ }
+
+ public static void setTripHome(StartTrip home) {
+ startPoint = null;
+ distance = 0.0;
+ TRIP_HOME = home;
+ Log.d("oppm","trip reset");
+ }
+
+ @Override
+ public void onCreate() {
+ startListening();
+ Log.d("oppm","gps started");
+ }
+
+ @Override
+ public void onDestroy() {
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+ // This is the object that receives interactions from clients. See
+ // RemoteService for a more complete example.
+ private final IBinder mBinder = new LocalBinder();
+
+ private void startListening() {
+
+ Criteria criterion = new Criteria();
+ String bestProvider;
+
+ if (mLocationManager == null) {
+ mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
+ }
+
+ if (debug) {
+
+ criterion.setAccuracy(Criteria.ACCURACY_FINE);
+ bestProvider = mLocationManager.getBestProvider(criterion, true);
+ Log.d("oppm","best gps: " + bestProvider + " enabled: " + mLocationManager.isProviderEnabled(bestProvider));
+
+ }
+
+ mLocationManager.requestLocationUpdates(
+ LocationManager.NETWORK_PROVIDER,
+ 0,
+ 0,
+ this
+ );
+ }
+
+ private void stopListening() {
+ if (mLocationManager != null)
+ mLocationManager.removeUpdates(this);
+ }
+
+ //@Override
+ public void onLocationChanged(Location loc) {
+ lLastTime = lCurrTime;
+ lCurrTime = System.currentTimeMillis();
+
+ float fDist = 0; //Holds distance since last GPS update
+
+ if (mLoc != null)
+ {fDist = loc.distanceTo(mLoc);
+ distance += fDist;
+ }
+
+ long lElapsedTime = (lCurrTime - lLastTime);
+ mSpeed = fDist / lElapsedTime * 1000;
+
+ Coordinate coordCurrent = new Coordinate(
+ (float)loc.getLongitude(),
+ (float)loc.getLatitude());
+ Coordinate coordOld = new Coordinate(
+ (float)mLoc.getLongitude(),
+ (float)mLoc.getLatitude());
+
+ mLoc = loc;
+
+ //Let MainActivity know about the new location
+ TRIP_HOME.updateGPS();
+ }
+
+ //@Override
+ public void onProviderDisabled(String provider) {
+ if (debug) Log.d("oppm","gps provider " + provider + " disabled.");
+ }
+
+ //@Override
+ public void onProviderEnabled(String provider) {
+ if (debug) Log.d("oppm","gps provider " + provider + " enabled.");
+ }
+
+ //@Override
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+ if (debug) Log.d("oppm","gps provide r" + provider + " status: " + status);
+ }
+
+
+}
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/MainSplash.java b/GreenTravel/src/org/commoditysoftware/greentravel/MainSplash.java
new file mode 100644
index 00000000..e48a5387
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/MainSplash.java
@@ -0,0 +1,47 @@
+package org.commoditysoftware.greentravel;
+
+import android.app.Activity;
+import android.os.IBinder;
+import android.os.Bundle;
+import android.content.ServiceConnection;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.util.Log;
+
+public class MainSplash extends Activity {
+
+ String version;
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ try {
+ version = getPackageManager().getPackageInfo(getPackageName(),
+ PackageManager.GET_ACTIVITIES).versionName;
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ version = "Unknown";
+ }
+ Log.d("oppm","main");
+ setContentView(R.layout.main);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.splash_screen_layout);
+ ((TextView) findViewById(R.id.version)).setText("Version " + version);
+
+
+ // wait three seconds and start our activity
+ layout.postDelayed(new Runnable() {
+ //@Override
+ public void run() {
+ startActivity(new Intent(MainSplash.this, Screen1.class));
+ //finish();
+ }
+ }, 2000);
+ }
+
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/Screen1.java b/GreenTravel/src/org/commoditysoftware/greentravel/Screen1.java
new file mode 100644
index 00000000..a8655ba0
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/Screen1.java
@@ -0,0 +1,59 @@
+package org.commoditysoftware.greentravel;
+
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Button;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.net.Uri;
+
+public class Screen1 extends Activity {
+
+ private static final String LEARNMORE_URL = "http://www.nrdc.org/globalwarming/f101.asp";
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.screen1);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.screen1_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("This app uses GPS to apply a model of energy consumption "
+ + "to distance and time on trip. "
+ );
+ ((TextView) findViewById(R.id.TextView02)).
+ setText("In the finished Green Driving app this would support users contributing "
+ + "in direct proportion to thier contributed carbon burden. "
+ );
+ // Hook up button presses to the appropriate event handler.
+ ((Button) findViewById(R.id.learnMore)).setOnClickListener(mLearnMore);
+ ((Button) findViewById(R.id.proceedToTrip)).setOnClickListener(mProceedToTrip);
+
+ }
+
+ /**
+ * A call-back for when the user presses the Learn More button.
+ */
+ OnClickListener mLearnMore = new OnClickListener() {
+ public void onClick(View v) {
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse(LEARNMORE_URL));
+ startActivity(i);
+ }
+ };
+
+ /**
+ * A call-back for when the user presses the Proceed button.
+ */
+ OnClickListener mProceedToTrip = new OnClickListener() {
+ public void onClick(View v) {
+ startActivity(new Intent(Screen1.this, StartTrip.class));
+ finish();
+ }
+ };
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/Screen4.java b/GreenTravel/src/org/commoditysoftware/greentravel/Screen4.java
new file mode 100644
index 00000000..1fc6ea45
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/Screen4.java
@@ -0,0 +1,48 @@
+package org.commoditysoftware.greentravel;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.net.Uri;
+
+public class Screen4 extends Activity {
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.results);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.screen4_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Stub for page 4 of the PDF: Modify Screen4.java,xml " +
+ " as needed. Screen1 does what PDF indicates this needs to.");
+ ((Button) findViewById(R.id.donateNow)).setOnClickListener(mDonate);
+ ((Button) findViewById(R.id.whoYouIs)).setOnClickListener(mWRU);
+ }
+
+ /**
+ * A call-back for when the user presses the Do Something button.
+ */
+ OnClickListener mDonate = new OnClickListener() {
+ public void onClick(View v) {
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse("http://paypal.com"));
+ startActivity(i);
+ }
+ };
+ /**
+ * A call-back for when the user presses the Do Something button.
+ */
+ OnClickListener mWRU = new OnClickListener() {
+ public void onClick(View v) {
+ startActivity(new Intent(Screen4.this, Screen5.class));
+ }
+ };
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/Screen5.java b/GreenTravel/src/org/commoditysoftware/greentravel/Screen5.java
new file mode 100644
index 00000000..b8252cee
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/Screen5.java
@@ -0,0 +1,26 @@
+package org.commoditysoftware.greentravel;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+
+public class Screen5 extends Activity {
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.results);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.screen5_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Stub for page 5 of the PDF: Modify Screen5.java,xml " +
+ " as needed. Screen1 does what PDF indicates this needs to.");
+ }
+
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/Screen7.java b/GreenTravel/src/org/commoditysoftware/greentravel/Screen7.java
new file mode 100644
index 00000000..a1e522df
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/Screen7.java
@@ -0,0 +1,26 @@
+package org.commoditysoftware.greentravel;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+
+public class Screen7 extends Activity {
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.results);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.screen7_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Stub for screen7 of the PDF: Modify Screen7.java,xml " +
+ " as needed. Screen1 does what PDF indicates this needs to.");
+ }
+
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/SettingsActivity.java b/GreenTravel/src/org/commoditysoftware/greentravel/SettingsActivity.java
new file mode 100644
index 00000000..fb856fb8
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/SettingsActivity.java
@@ -0,0 +1,27 @@
+package org.commoditysoftware.greentravel;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Intent;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+
+public class SettingsActivity extends Activity {
+
+ String version;
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.settings);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.settings_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Current model settings to use. Consult the nrdc site or other sources. ");
+ ((TextView) findViewById(R.id.co2)).
+ setText("" + GreenTravelService.co2Rate);
+ }
+
+}
\ No newline at end of file
diff --git a/GreenTravel/src/org/commoditysoftware/greentravel/StartTrip.java b/GreenTravel/src/org/commoditysoftware/greentravel/StartTrip.java
new file mode 100644
index 00000000..ae52d83e
--- /dev/null
+++ b/GreenTravel/src/org/commoditysoftware/greentravel/StartTrip.java
@@ -0,0 +1,141 @@
+package org.commoditysoftware.greentravel;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Chronometer;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.util.Log;
+import android.content.Context;
+import java.text.DecimalFormat;
+
+public class StartTrip extends Activity {
+
+ private static boolean paused;
+ private Chronometer clock;
+ private Menu mMenu;
+ private MenuItem mPauseResume;
+ private TextView mDistance,mLatitude,mLongitude,mVelocity;
+
+ private static final int MENU_START = Menu.FIRST;
+ private static final int MENU_PAUSE = Menu.FIRST + 1;
+ private static final int MENU_END = Menu.FIRST + 2;
+ private static final int MENU_SETTINGS = Menu.FIRST + 3;
+
+ private Intent gdsIntention;
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.start_trip);
+ LinearLayout layout = (LinearLayout) findViewById(R.id.start_trip_layout);
+ ((TextView) findViewById(R.id.TextView01)).
+ setText("Use the Android menu to control your trip. ");
+ ((TextView) findViewById(R.id.TextView02)).
+ setText("Use pause if the fuel burning portion of your "
+ + "trip is interrupted. Use end to "
+ + "see the environmental footprint of this trip."
+ );
+ ((TextView) findViewById(R.id.TextView03)).
+ setText("This is an early version, exiting "
+ + " will cancel trip and there is no power optimization. "
+ );
+ mLatitude = ((TextView) findViewById(R.id.latitude));
+ mLongitude = ((TextView) findViewById(R.id.longitude));
+ mDistance = ((TextView) findViewById(R.id.distance));
+ mVelocity = ((TextView) findViewById(R.id.velocity));
+ clock = ((Chronometer) findViewById(R.id.Chronometer01));
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(final Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ mMenu = menu;
+ MenuItem menuItem = menu.add(0, MENU_START, 0, "Start Trip");
+ menuItem.setIcon(R.drawable.ic_menu_start);
+ menuItem = menu.add(0, MENU_SETTINGS, 0, "Change Model Settings");
+ menuItem.setIcon(R.drawable.ic_menu_settings);
+ mPauseResume = menu.add(0, MENU_PAUSE, 0, "Pause");
+ mPauseResume.setIcon(R.drawable.ic_menu_pause);
+ menuItem = menu.add(0, MENU_END, 0, "End Trip");
+ menuItem.setIcon(R.drawable.ic_menu_end);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(final MenuItem item) {
+ int itemid = item.getItemId();
+ switch (itemid) {
+ case MENU_START:
+ //Start GPS service
+ paused = false;
+ GreenTravelService.setTripHome(this);
+ startService(new Intent(this, GreenTravelService.class));
+ clock.start();
+ break;
+ case MENU_PAUSE:
+ if (!paused) {
+ mPauseResume.setIcon(R.drawable.ic_menu_resume);
+ clock.stop();
+ paused = true;
+ }
+ else {paused = false;
+ clock.start();
+ mPauseResume.setIcon(R.drawable.ic_menu_pause);
+ }
+ break;
+ case MENU_END:
+ clock.stop();
+ stopService (new Intent(this, GreenTravelService.class));
+ if ((GreenTravelService.distance * 0.6214) > 10) {
+ startActivity(new Intent(StartTrip.this, EndTripActivity.class)
+ .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
+ } else {
+ startActivity(new Intent(StartTrip.this, Screen7.class)
+ .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
+ }
+ break;
+ case MENU_SETTINGS:
+ startActivity(new Intent(StartTrip.this, SettingsActivity.class));
+ break;
+ default:
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ public void updateGPS() {
+ boolean starting = (GreenTravelService.startPoint == null);
+ DecimalFormat sevenDecimal = new DecimalFormat("#0.0000000");
+ DecimalFormat noDecimal = new DecimalFormat("#0");
+
+ Coordinate here = new Coordinate(
+ (float)GreenTravelService.getLocation().getLongitude(),
+ (float)GreenTravelService.getLocation().getLatitude());
+
+ if (starting) {
+ GreenTravelService.startPoint = new Coordinate(
+ (float)GreenTravelService.getLocation().getLongitude(),
+ (float)GreenTravelService.getLocation().getLatitude());
+ }
+
+
+ if(!starting) {
+ mLatitude.setText(sevenDecimal.format(here.getLatitude()));
+ mLongitude.setText(sevenDecimal.format(here.getLongitude()));
+ mDistance.setText(noDecimal.format(here.distanceTo(GreenTravelService.startPoint)));
+ mVelocity.setText(noDecimal.format(GreenTravelService.getSpeed()));
+ }
+ else {
+ mLatitude.setText("---");
+ mLongitude.setText("---");
+ mDistance.setText("---");
+ mVelocity.setText(noDecimal.format(0.0));
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/README b/README
index e69de29b..271e1641 100644
--- a/README
+++ b/README
@@ -0,0 +1 @@
+
See the Market page for the app,
The complete Eclipse project is here.
\ No newline at end of file