diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml
index c5ee80a..bf4d6e7 100644
--- a/phoneClients/android/.idea/workspace.xml
+++ b/phoneClients/android/.idea/workspace.xml
@@ -46,15 +46,7 @@
-
-
-
-
-
-
-
-
-
+
@@ -121,7 +113,7 @@
-
+
@@ -784,10 +776,10 @@
-
-
-
-
+
+
+
+
@@ -1086,7 +1078,7 @@
-
+
@@ -1095,20 +1087,20 @@
-
+
-
+
-
+
@@ -1570,7 +1562,7 @@
-
+
diff --git a/phoneClients/android/GpsTracker.iml b/phoneClients/android/GpsTracker.iml
new file mode 100644
index 0000000..8c0cc17
--- /dev/null
+++ b/phoneClients/android/GpsTracker.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phoneClients/android/GpsTracker/.gitignore b/phoneClients/android/GpsTracker/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/phoneClients/android/GpsTracker/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/phoneClients/android/GpsTracker/GpsTracker.iml b/phoneClients/android/GpsTracker/GpsTracker.iml
deleted file mode 100644
index 5eb124c..0000000
--- a/phoneClients/android/GpsTracker/GpsTracker.iml
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/phoneClients/android/GpsTracker/build.gradle b/phoneClients/android/GpsTracker/build.gradle
deleted file mode 100644
index f3c09ca..0000000
--- a/phoneClients/android/GpsTracker/build.gradle
+++ /dev/null
@@ -1,35 +0,0 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.9.+'
- }
-}
-apply plugin: 'android'
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- // check here and change the version (1.4.4) below if necessary. http://loopj.com/android-async-http/
- compile group: 'com.loopj.android', name: 'android-async-http', version: '1.4.4'
-}
-
-android {
- compileSdkVersion 19
- buildToolsVersion '19.0.3'
-
- defaultConfig {
- minSdkVersion 10
- targetSdkVersion 19
- }
-}
-
-dependencies {
- compile 'com.android.support:appcompat-v7:+'
- // check here and change the version (4.3.23) below if necessary. http://developer.android.com/google/play-services/setup.html
- compile 'com.google.android.gms:play-services:4.3.23'
-}
-
diff --git a/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml b/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml
deleted file mode 100644
index f75ccf1..0000000
--- a/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png b/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png
deleted file mode 100644
index 5c63bc5..0000000
--- a/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png
+++ /dev/null
Binary files differ
diff --git a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java b/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
deleted file mode 100644
index f6bfbe2..0000000
--- a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
+++ /dev/null
@@ -1,268 +0,0 @@
-package com.websmithing.gpstracker;
-
-import android.location.Location;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v7.app.ActionBarActivity;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.TextView;
-
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GooglePlayServicesClient;
-import com.google.android.gms.common.GooglePlayServicesUtil;
-import com.google.android.gms.location.LocationClient;
-import com.google.android.gms.location.LocationListener;
-import com.google.android.gms.location.LocationRequest;
-import com.loopj.android.http.AsyncHttpResponseHandler;
-import com.loopj.android.http.RequestParams;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-import java.util.UUID;
-
-public class GpsTrackerActivity extends ActionBarActivity implements LocationListener, GooglePlayServicesClient.ConnectionCallbacks,
- GooglePlayServicesClient.OnConnectionFailedListener {
-
- private static final String TAG = "GpsTrackerActivity";
- private static TextView longitudeTextView;
- private static TextView latitudeTextView;
- private static TextView accuracyTextView;
- private static TextView providerTextView;
- private static TextView timeStampTextView;
- private static TextView phoneNumberTextView;
-
- private LocationRequest locationRequest;
- private LocationClient locationClient;
- private Location previousLocation;
- private float totalDistanceInMeters = 0.0f;
- private boolean firstTimeGettingPosition = true;
- private boolean currentlyTracking = false;
- private String sessionID;
- private String shortSessionID;
- private String phoneNumber = "androidUser";
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_gpstracker);
-
- if (savedInstanceState == null) {
- getSupportFragmentManager().beginTransaction()
- .add(R.id.container, new PlaceholderFragment())
- .commit();
- }
-
- int response = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
- if(response == ConnectionResult.SUCCESS){
- locationClient = new LocationClient(this,this,this);
- locationClient.connect();
- }
- else{
- Log.e(TAG, "google play service error: " + response);
- }
- }
-
- // called when startTrackingButton is tapped
- public void trackLocation(View v) {
- if (currentlyTracking) {
- ((Button) v).setText("start tracking");
- stopTracking();
- currentlyTracking = false;
- } else {
- ((Button) v).setText("stop tracking");
- startTracking();
- currentlyTracking = true;
- }
- }
-
- protected void startTracking() {
- sessionID = UUID.randomUUID().toString();
- shortSessionID = sessionID.substring(0,5);
- phoneNumberTextView.setText("phoneNumber: " + phoneNumber + "-" + shortSessionID);
-
- totalDistanceInMeters = 0.0f;
- int intervalInSeconds = 60; // one minute
- locationRequest = LocationRequest.create();
- locationRequest.setInterval(intervalInSeconds * 1000);
- locationRequest.setFastestInterval(intervalInSeconds * 1000); // the fastest rate in milliseconds at which your app can handle location updates
- locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
- locationClient.requestLocationUpdates(locationRequest, this);
- }
-
- protected void stopTracking() {
- phoneNumberTextView.setText("phoneNumber: ");
-
- if (locationClient != null && locationClient.isConnected()) {
- locationClient.removeLocationUpdates(this);
- locationClient.disconnect();
- }
- }
-
- @Override
- public void onLocationChanged(Location location) {
- if (location != null) {
- displayLocationData(location);
- sendLocationDataToWebsite(location);
- }
- }
-
- protected void sendLocationDataToWebsite(Location location) {
- // formatted for mysql datetime format
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- dateFormat.setTimeZone(TimeZone.getDefault());
- Date date = new Date(location.getTime());
-
- if (firstTimeGettingPosition) {
- firstTimeGettingPosition = false;
- } else {
- float distance = location.distanceTo(previousLocation);
- totalDistanceInMeters += distance;
- }
-
- previousLocation = location;
-
- RequestParams requestParams = new RequestParams();
- requestParams.put("latitude", Double.toString(location.getLatitude()));
- requestParams.put("longitude", Double.toString(location.getLongitude()));
- requestParams.put("speed", Double.toString(location.getSpeed())); // in miles per hour
-
- try {
- requestParams.put("date", URLEncoder.encode(dateFormat.format(date), "UTF-8"));
- } catch (UnsupportedEncodingException e) {}
-
- requestParams.put("locationmethod", location.getProvider());
-
- if ( totalDistanceInMeters > 0) {
- requestParams.put("distance", totalDistanceInMeters / 1609); // in miles
- } else {
- requestParams.put("distance", 0); // in miles
- }
-
- String shortSessionID = sessionID.substring(0,5);
-
- requestParams.put("phonenumber", "androidUser");
- requestParams.put("sessionid", sessionID); // uuid
- requestParams.put("accuracy", Float.toString(location.getAccuracy())); // in meters
- requestParams.put("extrainfo", Double.toString(location.getAltitude()));
- requestParams.put("eventtype", "android");
- requestParams.put("direction", Float.toString(location.getBearing()));
-
- MyHttpClient.post(null, requestParams, new AsyncHttpResponseHandler() {
- @Override
- public void onSuccess(int statusCode, org.apache.http.Header[] headers, byte[] responseBody) {
- try {
- String response = new String(responseBody, "UTF-8");
- Log.e(TAG, "onSuccess statusCode: " + statusCode + " responseBody: " + response);
- } catch (UnsupportedEncodingException e) {}
- }
- @Override
- public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] errorResponse, Throwable e) {
- Log.e(TAG, "onFailure statusCode: " + statusCode + " errorResponse: " + errorResponse);
- }
- });
- }
-
- protected void displayLocationData(Location location) {
- DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
- dateFormat.setTimeZone(TimeZone.getDefault());
- Date date = new Date(location.getTime());
-
- longitudeTextView.setText("longitude: " + location.getLongitude());
- latitudeTextView.setText("latitude: " + location.getLatitude());
- accuracyTextView.setText("accuracy: " + location.getAccuracy());
- providerTextView.setText("provider: " + location.getProvider());
- timeStampTextView.setText("timeStamp: " + dateFormat.format(date));
-
- Log.e(TAG, dateFormat.format(date) + " accuracy: " + location.getAccuracy());
- }
-
- @Override
- protected void onStart() {
- Log.e(TAG, "onStart");
- super.onStart();
- // Connect the client.
- //mLocationClient.connect();
- }
-
- @Override
- protected void onStop() {
- Log.e(TAG, "onStop");
-
- if (locationClient != null && locationClient.isConnected()) {
- locationClient.removeLocationUpdates(this);
- locationClient.disconnect();
- }
-
- super.onStop();
- }
-
- /**
- * Called by Location Services when the request to connect the
- * client finishes successfully. At this point, you can
- * request the current location or start periodic updates
- */
- @Override
- public void onConnected(Bundle bundle) {
- Log.e(TAG, "onConnected");
- }
-
- /**
- * Called by Location Services if the connection to the
- * location client drops because of an error.
- */
- @Override
- public void onDisconnected() {
- Log.e(TAG, "onDisconnected");
- }
-
- @Override
- public void onConnectionFailed(ConnectionResult connectionResult) {
- Log.e(TAG, "onConnectionFailed");
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.gps_tracker, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- switch (item.getItemId()) {
- case R.id.action_settings:
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-
- public static class PlaceholderFragment extends Fragment {
- public PlaceholderFragment() {
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_gpstracker, container, false);
- longitudeTextView = (TextView)rootView.findViewById(R.id.longitudeTextView);
- latitudeTextView = (TextView)rootView.findViewById(R.id.latitudeTextView);
- accuracyTextView = (TextView)rootView.findViewById(R.id.accuracyTextView);
- providerTextView = (TextView)rootView.findViewById(R.id.providerTextView);
- timeStampTextView = (TextView)rootView.findViewById(R.id.timeStampTextView);
- phoneNumberTextView = (TextView)rootView.findViewById(R.id.phoneNumberTextView);
- return rootView;
- }
- }
-}
diff --git a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java b/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java
deleted file mode 100644
index 57747a4..0000000
--- a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.websmithing.gpstracker;
-
-import com.loopj.android.http.AsyncHttpClient;
-import com.loopj.android.http.AsyncHttpResponseHandler;
-import com.loopj.android.http.RequestParams;
-
-public class MyHttpClient {
-
- // use the websmithing defaultUploadWebsite for testing, change the *phoneNumber* form variable to something you
- // know and then check your location with your browser here: https://www.websmithing.com/gpstracker/displaymap.php
-
- private static final String defaultUploadWebsite = "https://www.websmithing.com/gpstracker/updatelocation.php";
- private static AsyncHttpClient client = new AsyncHttpClient();
-
- public static void post(String url, RequestParams requestParams, AsyncHttpResponseHandler responseHandler) {
- client.post(defaultUploadWebsite, requestParams, responseHandler);
- }
-}
diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 55621cc..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 11ec206..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index 7c02b78..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644
index 915d914..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml b/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml
deleted file mode 100644
index 33784e1..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml b/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml
deleted file mode 100644
index 553cf92..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/phoneClients/android/GpsTracker/src/main/res/menu/gps_tracker.xml b/phoneClients/android/GpsTracker/src/main/res/menu/gps_tracker.xml
deleted file mode 100644
index 9cdba38..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/menu/gps_tracker.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
diff --git a/phoneClients/android/GpsTracker/src/main/res/values-w820dp/dimens.xml b/phoneClients/android/GpsTracker/src/main/res/values-w820dp/dimens.xml
deleted file mode 100644
index 63fc816..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/values-w820dp/dimens.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- 64dp
-
diff --git a/phoneClients/android/GpsTracker/src/main/res/values/dimens.xml b/phoneClients/android/GpsTracker/src/main/res/values/dimens.xml
deleted file mode 100644
index a0171a7..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- 16dp
- 16dp
-
-
diff --git a/phoneClients/android/GpsTracker/src/main/res/values/strings.xml b/phoneClients/android/GpsTracker/src/main/res/values/strings.xml
deleted file mode 100644
index 6ecbdea..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
- GpsTracker
- hello worldish
- latitude:
- longitude:
- provider:
- timeStamp:
- accuracy:
- sessionID:
- phoneNumber:
- start tracking
-
-
- %1$s %2$s %3$s
-
-
- %1$.8f, %2$.8f
-
-
- Settings
-
-
- Lat/Long:
- Address:
-
-
- Client connected
- Unknown connection error code: %1$d
- Connection failed
- Client disconnected
- Get Address
- Get Location
-
- Illegal arguments: Latitude %1$.8f Longitude %2$.8f
-
- Invalid intent action %1$s
- Invalid integer request ID: %1$s
- IO Exception in Geocoder.getFromLocation()
- Periodic updates requested
- Location updated
- Location update failed
-
- Location update error. code %1$d message %2$s
-
-
- Location update error. No incoming location.
-
- Periodic updates stopped
- New location: %1$s
- No address found for location
- No connection: Cannot request location
- Cannot get address. No geocoder available.
- Location not available
- Error resolved. Please re-try operation.
- Google Play services: unable to resolve connection error.
- Stopping periodic updates
- Google Play services is available
-
- Can\'t request location updates, previous request hasn\'t finished
-
- Start Updates
- Stop Updates
- --Unknown--
-
- Received an unknown activity request code %1$d in onActivityResult.
-
-
- Connection failure error code: %1$d
- Google Play services is disabled
- An internal error occurred
- The version of Google Play services on this device is not authentic
- The specified account name is invalid
- The app is not licensed to the user
- Connection failure error message: %1$s
- The application is misconfigured
- Google Play services is missing
- Additional resolution is required
- A network error occurred
- Google Play services is out of date
- The user is not signed in
- An unknown error occurred
-
-
\ No newline at end of file
diff --git a/phoneClients/android/GpsTracker/src/main/res/values/styles.xml b/phoneClients/android/GpsTracker/src/main/res/values/styles.xml
deleted file mode 100644
index 00a7ff8..0000000
--- a/phoneClients/android/GpsTracker/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/phoneClients/android/GpsTrackerProject.iml b/phoneClients/android/GpsTrackerProject.iml
deleted file mode 100644
index 2140a04..0000000
--- a/phoneClients/android/GpsTrackerProject.iml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/phoneClients/android/README.md b/phoneClients/android/README.md
index 0301667..a466e41 100644
--- a/phoneClients/android/README.md
+++ b/phoneClients/android/README.md
@@ -1,11 +1,7 @@
-This project was built with *android studio* and is completed and works fine with both servers.
+This project was built with *android studio* and works fine with both servers.
-use the websmithing defaultUploadWebsite:
+This version is the same as the current version in the Google Play store.
-https://www.websmithing.com/gpstracker/updatelocation.php
-
-for testing
-
-change the *phoneNumber* form variable to something you know and then check your location with your browser here:
+for testing check your location with your browser here:
https://www.websmithing.com/gpstracker/displaymap.php
diff --git a/phoneClients/android/android.iml b/phoneClients/android/android.iml
deleted file mode 100644
index 8c0cc17..0000000
--- a/phoneClients/android/android.iml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/phoneClients/android/app/.gitignore b/phoneClients/android/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/phoneClients/android/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/phoneClients/android/app/app.iml b/phoneClients/android/app/app.iml
new file mode 100644
index 0000000..67dc562
--- /dev/null
+++ b/phoneClients/android/app/app.iml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phoneClients/android/app/build.gradle b/phoneClients/android/app/build.gradle
new file mode 100644
index 0000000..f242d4a
--- /dev/null
+++ b/phoneClients/android/app/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'android'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "19.0.3"
+
+ defaultConfig {
+ minSdkVersion 10
+ targetSdkVersion 19
+ versionCode 1
+ versionName "3.2.0"
+ }
+ buildTypes {
+ release {
+ runProguard false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.android.support:appcompat-v7:+'
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+
+ compile 'com.google.android.gms:play-services:4.3.23'
+}
diff --git a/phoneClients/android/app/proguard-rules.txt b/phoneClients/android/app/proguard-rules.txt
new file mode 100644
index 0000000..cb8998d
--- /dev/null
+++ b/phoneClients/android/app/proguard-rules.txt
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
\ No newline at end of file
diff --git a/phoneClients/android/app/src/main/AndroidManifest.xml b/phoneClients/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..3895fff
--- /dev/null
+++ b/phoneClients/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
new file mode 100644
index 0000000..a37efec
--- /dev/null
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
@@ -0,0 +1,268 @@
+package com.websmithing.gpstracker;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.location.Location;
+import android.os.Bundle;
+import android.os.SystemClock;
+import android.support.v7.app.ActionBarActivity;
+import android.util.Log;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RadioGroup;
+import android.widget.Toast;
+
+import com.google.android.gms.common.ConnectionResult;
+import com.google.android.gms.common.GooglePlayServicesUtil;
+import com.google.android.gms.location.LocationClient;
+import com.google.android.gms.location.LocationRequest;
+import com.loopj.android.http.AsyncHttpResponseHandler;
+
+import java.util.UUID;
+
+
+public class GpsTrackerActivity extends ActionBarActivity {
+ private static final String TAG = "GpsTrackerActivity";
+
+ // use the websmithing defaultUploadWebsite for testing and then check your
+ // location with your browser here: https://www.websmithing.com/gpstracker/displaymap.php
+ private String defaultUploadWebsite;
+
+ private static EditText txtUserName;
+ private static EditText txtWebsite;
+ private static Button trackingButton;
+ private static Button saveButton;
+
+ private LocationRequest locationRequest;
+ private LocationClient locationClient;
+ private Location previousLocation;
+ private float totalDistanceInMeters = 0.0f;
+ private boolean firstTimeGettingPosition = true;
+ private boolean currentlyTracking;
+ private String sessionID;
+ private RadioGroup intervalRadioGroup;
+ private int intervalInMinutes = 1;
+ private AlarmManager alarmManager;
+ private Intent gpsTrackerIntent;
+ private PendingIntent pendingIntent;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_gpstracker);
+
+ defaultUploadWebsite = getString(R.string.default_upload_website);
+
+ txtWebsite = (EditText)findViewById(R.id.txtWebsite);
+ txtUserName = (EditText)findViewById(R.id.txtUserName);
+ trackingButton = (Button)findViewById(R.id.trackingButton);
+ saveButton = (Button)findViewById(R.id.saveButton);
+ txtUserName.setImeOptions(EditorInfo.IME_ACTION_DONE);
+
+ SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+ currentlyTracking = sharedPreferences.getBoolean("currentlyTracking", false);
+
+ trackingButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ trackLocation(v);
+ }
+ });
+
+ saveButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ saveUserSettings();
+ }
+ });
+ }
+
+ private void startAlarmManager(Context context) {
+ Log.d(TAG, "startAlarmManager");
+ alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ gpsTrackerIntent = new Intent(context, GpsTrackerAlarmReceiver.class);
+ pendingIntent = PendingIntent.getBroadcast(context, 0, gpsTrackerIntent, 0);
+
+ alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+ SystemClock.elapsedRealtime(),
+ intervalInMinutes * 60000, // 60000 = 1 minute
+ pendingIntent);
+ }
+
+ private void cancelAlarm() {
+ Log.d(TAG, "cancelAlarm");
+ if (alarmManager != null) {
+ alarmManager.cancel(pendingIntent);
+ alarmManager = null;
+ }
+ }
+
+ // called when trackingButton is tapped
+ protected void trackLocation(View v) {
+ SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+
+ if (textFieldsAreEmptyOrHaveSpaces()) {
+ return;
+ } else {
+ // just in case user forgets to save username
+ String tempUser = sharedPreferences.getString("userName", "");
+ if (tempUser.trim().length() == 0) {
+ editor.putString("userName", txtUserName.getText().toString().trim());
+ editor.commit();
+ }
+ }
+
+ if (!checkIfGooglePlayEnabled()) {
+ return;
+ }
+
+ if (currentlyTracking) {
+ ((Button) v).setText(getText(R.string.start_tracking));
+
+ cancelAlarm();
+
+ currentlyTracking = false;
+ editor.putBoolean("currentlyTracking", false);
+ editor.putString("sessionID", "");
+ } else {
+ ((Button) v).setText(getText(R.string.stop_tracking));
+
+ startAlarmManager(getBaseContext());
+
+ currentlyTracking = true;
+ editor.putBoolean("currentlyTracking", true);
+ editor.putString("sessionID", UUID.randomUUID().toString());
+ }
+
+ editor.commit();
+ }
+
+ private void saveUserSettings() {
+ if (textFieldsAreEmptyOrHaveSpaces()) {
+ return;
+ }
+
+ checkIfWebsiteIsReachable();
+
+ SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+
+ switch (intervalRadioGroup.getCheckedRadioButtonId()) {
+ case R.id.i1:
+ editor.putInt("intervalInMinutes", 1);
+ break;
+ case R.id.i5:
+ editor.putInt("intervalInMinutes", 5);
+ break;
+ case R.id.i15:
+ editor.putInt("intervalInMinutes", 15);
+ break;
+ case R.id.i30:
+ editor.putInt("intervalInMinutes", 30);
+ break;
+ case R.id.i60:
+ editor.putInt("intervalInMinutes", 60);
+ break;
+ }
+
+ editor.putString("userName", txtUserName.getText().toString().trim());
+ editor.putString("defaultUploadWebsite", txtWebsite.getText().toString().trim());
+
+ editor.commit();
+
+ Toast.makeText(this, R.string.setting_saved, Toast.LENGTH_SHORT).show();
+ }
+
+ private boolean textFieldsAreEmptyOrHaveSpaces() {
+ String tempUserName = txtUserName.getText().toString().trim();
+ String tempWebsite = txtWebsite.getText().toString().trim();
+
+ if (tempWebsite.length() == 0 || hasSpaces(tempWebsite) || tempUserName.length() == 0 || hasSpaces(tempUserName)) {
+ Toast.makeText(this, R.string.textfields_empty_or_spaces, Toast.LENGTH_LONG).show();
+ return true;
+ }
+
+ return false;
+ }
+
+ private boolean hasSpaces(String str) {
+ return (str.split(" ").length > 1) ? true : false;
+ }
+
+ private void displayUserSettings() {
+ SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+ int interval = sharedPreferences.getInt("intervalInMinutes", 1);
+
+ intervalRadioGroup = (RadioGroup)findViewById(R.id.intervalRadioGroup);
+
+ switch (intervalInMinutes) {
+ case 1:
+ intervalRadioGroup.check(R.id.i1);
+ break;
+ case 5:
+ intervalRadioGroup.check(R.id.i5);
+ break;
+ case 15:
+ intervalRadioGroup.check(R.id.i15);
+ break;
+ case 30:
+ intervalRadioGroup.check(R.id.i30);
+ break;
+ case 60:
+ intervalRadioGroup.check(R.id.i60);
+ break;
+ }
+
+ txtWebsite.setText(sharedPreferences.getString("defaultUploadWebsite", defaultUploadWebsite));
+ txtUserName.setText(sharedPreferences.getString("userName", ""));
+
+ if (currentlyTracking) {
+ trackingButton.setText(getText(R.string.stop_tracking));
+ } else {
+ trackingButton.setText(getText(R.string.start_tracking));
+ }
+ }
+
+ private boolean checkIfGooglePlayEnabled() {
+ if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS) {
+ return true;
+ } else {
+ Log.e(TAG, "unable to connect to google play services.");
+ Toast.makeText(getApplicationContext(), R.string.google_play_services_unavailable, Toast.LENGTH_LONG).show();
+ return false;
+ }
+ }
+
+ private void checkIfWebsiteIsReachable() {
+ LoopjHttpClient.get(defaultUploadWebsite, null, new AsyncHttpResponseHandler() {
+ @Override
+ public void onSuccess(int statusCode, org.apache.http.Header[] headers, byte[] responseBody) {
+ Log.e(TAG, "checkIfWebsiteIsReachable onSuccess statusCode: " + statusCode);
+ }
+ @Override
+ public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] errorResponse, Throwable e) {
+ Toast.makeText(getApplicationContext(), R.string.reachability_error, Toast.LENGTH_LONG).show();
+ Log.e(TAG, "checkIfWebsiteIsReachable onFailure statusCode: " + statusCode);
+ }
+ });
+ }
+
+ @Override
+ public void onResume() {
+ Log.d(TAG, "onResume");
+ super.onResume(); // Always call the superclass method first
+
+ displayUserSettings();
+ }
+
+ @Override
+ protected void onStop() {
+ Log.d(TAG, "onStop");
+ super.onStop();
+ }
+}
diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerAlarmReceiver.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerAlarmReceiver.java
new file mode 100644
index 0000000..e8b5516
--- /dev/null
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerAlarmReceiver.java
@@ -0,0 +1,14 @@
+package com.websmithing.gpstracker;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v4.content.WakefulBroadcastReceiver;
+
+// make sure we use a WakefulBroadcastReceiver so that we acquire a partial wakelock
+public class GpsTrackerAlarmReceiver extends WakefulBroadcastReceiver {
+ private static final String TAG = "GpsTrackerAlarmReceiver";
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ context.startService(new Intent(context, LocationService.class));
+ }
+}
diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerBootReceiver.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerBootReceiver.java
new file mode 100644
index 0000000..163eff3
--- /dev/null
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerBootReceiver.java
@@ -0,0 +1,32 @@
+package com.websmithing.gpstracker;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.SystemClock;
+
+public class GpsTrackerBootReceiver extends BroadcastReceiver {
+ private static final String TAG = "GpsTrackerBootReceiver";
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ Intent gpsTrackerIntent = new Intent(context, GpsTrackerAlarmReceiver.class);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, gpsTrackerIntent, 0);
+
+ SharedPreferences sharedPreferences = context.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+ int intervalInMinutes = sharedPreferences.getInt("intervalInMinutes", 1);
+ Boolean currentlyTracking = sharedPreferences.getBoolean("currentlyTracking", false);
+
+ if (currentlyTracking) {
+ alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+ SystemClock.elapsedRealtime(),
+ intervalInMinutes * 60000, // 60000 = 1 minute,
+ pendingIntent);
+ } else {
+ alarmManager.cancel(pendingIntent);
+ }
+ }
+}
diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
new file mode 100644
index 0000000..743cd9a
--- /dev/null
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
@@ -0,0 +1,197 @@
+package com.websmithing.gpstracker;
+
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.location.Location;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.util.Log;
+
+import com.google.android.gms.common.ConnectionResult;
+import com.google.android.gms.common.GooglePlayServicesClient;
+import com.google.android.gms.common.GooglePlayServicesUtil;
+import com.google.android.gms.location.LocationClient;
+import com.google.android.gms.location.LocationListener;
+import com.google.android.gms.location.LocationRequest;
+import com.loopj.android.http.AsyncHttpResponseHandler;
+import com.loopj.android.http.RequestParams;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+public class LocationService extends Service implements
+ GooglePlayServicesClient.ConnectionCallbacks,
+ GooglePlayServicesClient.OnConnectionFailedListener,
+ LocationListener {
+
+ private static final String TAG = "LocationService";
+
+ // use the websmithing defaultUploadWebsite for testing and then check your
+ // location with your browser here: https://www.websmithing.com/gpstracker/displaymap.php
+ private String defaultUploadWebsite;
+
+ private boolean currentlyProcessingLocation = false;
+ private LocationRequest locationRequest;
+ private LocationClient locationClient;
+ private Location previousLocation;
+ private float totalDistanceInMeters = 0.0f;
+ private boolean firstTimeGettingPosition = true;
+ //private boolean currentlyTracking = false;
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ defaultUploadWebsite = getString(R.string.default_upload_website);
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ // if we are currently trying to get a location and the alarm manager has called this again,
+ // no need to start processing a new location.
+ if (!currentlyProcessingLocation) {
+ startTracking();
+ }
+
+ return START_STICKY;
+ }
+
+ private void startTracking() {
+ Log.d(TAG, "startTracking");
+
+ currentlyProcessingLocation = true;
+
+ // totalDistanceInMeters = 0.0f;
+
+ locationRequest = LocationRequest.create();
+ locationRequest.setInterval(1000); // milliseconds
+ locationRequest.setFastestInterval(1000); // the fastest rate in milliseconds at which your app can handle location updates
+ locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
+
+ if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS) {
+ locationClient = new LocationClient(this,this,this);
+
+ if (!locationClient.isConnected() || !locationClient.isConnecting()) {
+ locationClient.connect();
+ }
+ } else {
+ Log.e(TAG, "unable to connect to google play services.");
+ }
+ }
+
+ protected void sendLocationDataToWebsite(Location location) {
+ // formatted for mysql datetime format
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ dateFormat.setTimeZone(TimeZone.getDefault());
+ Date date = new Date(location.getTime());
+
+ if (firstTimeGettingPosition) {
+ firstTimeGettingPosition = false;
+ } else {
+ float distance = location.distanceTo(previousLocation);
+ totalDistanceInMeters += distance;
+ }
+
+ previousLocation = location;
+
+ RequestParams requestParams = new RequestParams();
+ requestParams.put("latitude", Double.toString(location.getLatitude()));
+ requestParams.put("longitude", Double.toString(location.getLongitude()));
+ requestParams.put("speed", Double.toString(location.getSpeed())); // in miles per hour
+
+ try {
+ requestParams.put("date", URLEncoder.encode(dateFormat.format(date), "UTF-8"));
+ } catch (UnsupportedEncodingException e) {}
+
+ requestParams.put("locationmethod", location.getProvider());
+
+ if ( totalDistanceInMeters > 0) {
+ requestParams.put("distance", totalDistanceInMeters / 1609); // in miles
+ } else {
+ requestParams.put("distance", 0); // in miles
+ }
+
+ SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
+
+ // phoneNumber is just an identifying string in the database, can be any identifier.
+ requestParams.put("phonenumber", sharedPreferences.getString("userName", ""));
+ requestParams.put("sessionid", sharedPreferences.getString("sessionID", "")); // uuid
+ requestParams.put("accuracy", Float.toString(location.getAccuracy())); // in meters
+ requestParams.put("extrainfo", Double.toString(location.getAltitude()));
+ requestParams.put("eventtype", "android");
+ requestParams.put("direction", Float.toString(location.getBearing()));
+
+ LoopjHttpClient.post(sharedPreferences.getString("defaultUploadWebsite", defaultUploadWebsite), requestParams, new AsyncHttpResponseHandler() {
+ @Override
+ public void onSuccess(int statusCode, org.apache.http.Header[] headers, byte[] responseBody) {
+ Log.e(TAG, "sendLocationDataToWebsite onSuccess statusCode: " + statusCode);
+ stopSelf();
+ }
+ @Override
+ public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] errorResponse, Throwable e) {
+ Log.e(TAG, "sendLocationDataToWebsite onFailure statusCode: " + statusCode);
+ stopSelf();
+ }
+ });
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+
+ if (locationClient != null && locationClient.isConnected()) {
+ locationClient.removeLocationUpdates(this);
+ locationClient.disconnect();
+ }
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+ @Override
+ public void onLocationChanged(Location location) {
+ if (location != null) {
+ Log.e(TAG, "position: " + location.getLatitude() + ", " + location.getLongitude() + " accuracy: " + location.getAccuracy());
+
+ // we have our desired accuracy of 100 meters so lets quit this service,
+ // onDestroy will be called and stop our location uodates
+ if (location.getAccuracy() < 100.0f) {
+ sendLocationDataToWebsite(location);
+ }
+ }
+ }
+
+ /**
+ * Called by Location Services when the request to connect the
+ * client finishes successfully. At this point, you can
+ * request the current location or start periodic updates
+ */
+ @Override
+ public void onConnected(Bundle bundle) {
+ Log.d(TAG, "onConnected");
+
+ locationClient.requestLocationUpdates(locationRequest, this);
+ }
+
+ /**
+ * Called by Location Services if the connection to the
+ * location client drops because of an error.
+ */
+ @Override
+ public void onDisconnected() {
+ Log.e(TAG, "onDisconnected");
+ }
+
+ @Override
+ public void onConnectionFailed(ConnectionResult connectionResult) {
+ Log.e(TAG, "onConnectionFailed");
+ }
+}
diff --git a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java
new file mode 100644
index 0000000..021472a
--- /dev/null
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LoopjHttpClient.java
@@ -0,0 +1,17 @@
+package com.websmithing.gpstracker;
+
+import com.loopj.android.http.AsyncHttpClient;
+import com.loopj.android.http.AsyncHttpResponseHandler;
+import com.loopj.android.http.RequestParams;
+
+public class LoopjHttpClient {
+ private static AsyncHttpClient client = new AsyncHttpClient();
+
+ public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
+ client.get(url, params, responseHandler);
+ }
+
+ public static void post(String url, RequestParams requestParams, AsyncHttpResponseHandler responseHandler) {
+ client.post(url, requestParams, responseHandler);
+ }
+}
diff --git a/phoneClients/android/app/src/main/res/drawable-hdpi/ic_launcher.png b/phoneClients/android/app/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100755
index 0000000..eb79cdb
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/phoneClients/android/app/src/main/res/drawable-mdpi/ic_launcher.png b/phoneClients/android/app/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100755
index 0000000..bcd3176
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/phoneClients/android/app/src/main/res/drawable-xhdpi/ic_launcher.png b/phoneClients/android/app/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100755
index 0000000..fbe7386
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/phoneClients/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/phoneClients/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100755
index 0000000..8270c3d
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/phoneClients/android/app/src/main/res/drawable-xxxhdpi/ic_launcher.png b/phoneClients/android/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100755
index 0000000..2cbd539
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/phoneClients/android/app/src/main/res/layout/activity_gpstracker.xml b/phoneClients/android/app/src/main/res/layout/activity_gpstracker.xml
new file mode 100644
index 0000000..71867d2
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/layout/activity_gpstracker.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phoneClients/android/app/src/main/res/menu/gps_tracker.xml b/phoneClients/android/app/src/main/res/menu/gps_tracker.xml
new file mode 100644
index 0000000..3f55dc7
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/menu/gps_tracker.xml
@@ -0,0 +1,10 @@
+
diff --git a/phoneClients/android/app/src/main/res/values-w820dp/dimens.xml b/phoneClients/android/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/phoneClients/android/app/src/main/res/values/dimens.xml b/phoneClients/android/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..a0171a7
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/values/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 16dp
+ 16dp
+
+
diff --git a/phoneClients/android/app/src/main/res/values/strings.xml b/phoneClients/android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..c10e009
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/values/strings.xml
@@ -0,0 +1,27 @@
+
+
+
+ GpsTracker
+ Hello world!
+ Settings
+
+ https://www.websmithing.com/gpstracker/updatelocation.php
+
+ Start Tracking
+ Stop Tracking
+ Save
+ Settings have been saved.
+ Cannot reach the website that you have entered. Did you spell it correctly? Does your website use http or https?
+ Please fill in both fields. User names cannot have a space.
+ Please go into Settings > Apps > All and enable Google Play Services.
+
+ user name
+ upload website
+ How often to update website. Updating more often wears down the battery faster. Update every:
+ 1 minute
+ 5 minutes
+ 15 minutes
+ 30 minutes
+ 1 hour
+
+
diff --git a/phoneClients/android/app/src/main/res/values/styles.xml b/phoneClients/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..00a7ff8
--- /dev/null
+++ b/phoneClients/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/phoneClients/android/build.gradle b/phoneClients/android/build.gradle
index 495c503..80eec1a 100644
--- a/phoneClients/android/build.gradle
+++ b/phoneClients/android/build.gradle
@@ -1 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.9.+'
+ }
+}
+
+allprojects {
+ repositories {
+ mavenCentral()
+ }
+}
diff --git a/phoneClients/android/gradle.properties b/phoneClients/android/gradle.properties
new file mode 100644
index 0000000..5d08ba7
--- /dev/null
+++ b/phoneClients/android/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Settings specified in this file will override any Gradle settings
+# configured through the IDE.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
\ No newline at end of file
diff --git a/phoneClients/android/gradle/wrapper/gradle-wrapper.properties b/phoneClients/android/gradle/wrapper/gradle-wrapper.properties
index de768a1..5de946b 100644
--- a/phoneClients/android/gradle/wrapper/gradle-wrapper.properties
+++ b/phoneClients/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Mar 11 04:39:36 PDT 2014
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
diff --git a/phoneClients/android/settings.gradle b/phoneClients/android/settings.gradle
index 46d6e02..e7b4def 100644
--- a/phoneClients/android/settings.gradle
+++ b/phoneClients/android/settings.gradle
@@ -1 +1 @@
-include ':GpsTracker'
+include ':app'