diff --git a/phoneClients/android/.idea/.name b/phoneClients/android/.idea/.name new file mode 100644 index 0000000..1fd74d1 --- /dev/null +++ b/phoneClients/android/.idea/.name @@ -0,0 +1 @@ +android \ No newline at end of file diff --git a/phoneClients/android/.idea/compiler.xml b/phoneClients/android/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/phoneClients/android/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/phoneClients/android/.idea/copyright/profiles_settings.xml b/phoneClients/android/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/phoneClients/android/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/phoneClients/android/.idea/encodings.xml b/phoneClients/android/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/phoneClients/android/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/phoneClients/android/.idea/gradle.xml b/phoneClients/android/.idea/gradle.xml new file mode 100644 index 0000000..d23b061 --- /dev/null +++ b/phoneClients/android/.idea/gradle.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/phoneClients/android/.idea/misc.xml b/phoneClients/android/.idea/misc.xml new file mode 100644 index 0000000..e2fb1f3 --- /dev/null +++ b/phoneClients/android/.idea/misc.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/phoneClients/android/.idea/modules.xml b/phoneClients/android/.idea/modules.xml new file mode 100644 index 0000000..168af5c --- /dev/null +++ b/phoneClients/android/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/phoneClients/android/.idea/scopes/scope_settings.xml b/phoneClients/android/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/phoneClients/android/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/phoneClients/android/.idea/vcs.xml b/phoneClients/android/.idea/vcs.xml new file mode 100644 index 0000000..a5dd086 --- /dev/null +++ b/phoneClients/android/.idea/vcs.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml new file mode 100644 index 0000000..8ae5ffa --- /dev/null +++ b/phoneClients/android/.idea/workspace.xml @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + 1387365720724 + 1387365720724 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phoneClients/android/Android/.gitignore b/phoneClients/android/Android/.gitignore new file mode 100644 index 0000000..d6bfc95 --- /dev/null +++ b/phoneClients/android/Android/.gitignore @@ -0,0 +1,4 @@ +.gradle +/local.properties +/.idea/workspace.xml +.DS_Store diff --git a/phoneClients/android/Android/.idea/.name b/phoneClients/android/Android/.idea/.name new file mode 100644 index 0000000..37cdced --- /dev/null +++ b/phoneClients/android/Android/.idea/.name @@ -0,0 +1 @@ +GpsTracker \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/compiler.xml b/phoneClients/android/Android/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/phoneClients/android/Android/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/phoneClients/android/Android/.idea/copyright/profiles_settings.xml b/phoneClients/android/Android/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..3572571 --- /dev/null +++ b/phoneClients/android/Android/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/encodings.xml b/phoneClients/android/Android/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/phoneClients/android/Android/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/phoneClients/android/Android/.idea/gradle.xml b/phoneClients/android/Android/.idea/gradle.xml new file mode 100644 index 0000000..aa006ab --- /dev/null +++ b/phoneClients/android/Android/.idea/gradle.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/phoneClients/android/Android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml b/phoneClients/android/Android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml new file mode 100644 index 0000000..2a05343 --- /dev/null +++ b/phoneClients/android/Android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml b/phoneClients/android/Android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml new file mode 100644 index 0000000..0997482 --- /dev/null +++ b/phoneClients/android/Android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/libraries/support_v4_19_0_0.xml b/phoneClients/android/Android/.idea/libraries/support_v4_19_0_0.xml new file mode 100644 index 0000000..0279a24 --- /dev/null +++ b/phoneClients/android/Android/.idea/libraries/support_v4_19_0_0.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/misc.xml b/phoneClients/android/Android/.idea/misc.xml new file mode 100644 index 0000000..b153e48 --- /dev/null +++ b/phoneClients/android/Android/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/phoneClients/android/Android/.idea/modules.xml b/phoneClients/android/Android/.idea/modules.xml new file mode 100644 index 0000000..a482390 --- /dev/null +++ b/phoneClients/android/Android/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/phoneClients/android/Android/.idea/scopes/scope_settings.xml b/phoneClients/android/Android/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/phoneClients/android/Android/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/phoneClients/android/Android/.idea/vcs.xml b/phoneClients/android/Android/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/phoneClients/android/Android/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/phoneClients/android/Android/Android.iml b/phoneClients/android/Android/Android.iml new file mode 100644 index 0000000..3f54ba1 --- /dev/null +++ b/phoneClients/android/Android/Android.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/phoneClients/android/Android/GpsTracker/.gitignore b/phoneClients/android/Android/GpsTracker/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/.gitignore @@ -0,0 +1 @@ +/build diff --git a/phoneClients/android/Android/GpsTracker/GpsTracker.iml b/phoneClients/android/Android/GpsTracker/GpsTracker.iml new file mode 100644 index 0000000..a4779a6 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/GpsTracker.iml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phoneClients/android/Android/GpsTracker/build.gradle b/phoneClients/android/Android/GpsTracker/build.gradle new file mode 100644 index 0000000..16e9707 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:0.6.+' + } +} +apply plugin: 'android' + +repositories { + mavenCentral() +} + +android { + compileSdkVersion 19 + buildToolsVersion "19.0.0" + + defaultConfig { + minSdkVersion 10 + targetSdkVersion 19 + } +} + +dependencies { + compile 'com.android.support:appcompat-v7:+' + compile 'com.google.android.gms:play-services:4.0.30' +} + diff --git a/phoneClients/android/Android/GpsTracker/src/main/AndroidManifest.xml b/phoneClients/android/Android/GpsTracker/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3f8e6a0 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/phoneClients/android/Android/GpsTracker/src/main/ic_launcher-web.png b/phoneClients/android/Android/GpsTracker/src/main/ic_launcher-web.png new file mode 100644 index 0000000..5c63bc5 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/ic_launcher-web.png Binary files differ diff --git a/phoneClients/android/Android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java b/phoneClients/android/Android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java new file mode 100644 index 0000000..3b235a9 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java @@ -0,0 +1,174 @@ +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; + + +public class GpsTrackerActivity extends ActionBarActivity implements LocationListener, GooglePlayServicesClient.ConnectionCallbacks, + GooglePlayServicesClient.OnConnectionFailedListener { + + private LocationRequest locationRequest; + private LocationClient locationClient; + + private static TextView longitudeTextView; + private static TextView latitudeTextView; + private static TextView accuracyTextView; + private static TextView providerTextView; + private static TextView timeStampTextView; + + @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(); + } + +/* + // create a new global location parameters object + locationRequest = LocationRequest.create(); + locationRequest.setInterval(5 * 1000); + locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); + locationRequest.setFastestInterval(60 * 1000); // interval ceiling +*/ + int response = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); + if(response == ConnectionResult.SUCCESS){ + locationClient = new LocationClient(this,this,this); + locationClient.connect(); + } + else{ + Log.e("GpsTrackerActivity", "google play service error: " + response); + } + } + + // called when startTrackingButton is tapped + public void startTracking(View v) { + Log.e("GpsTrackerActivity", "startTracking"); + ((Button) v).setText("stop tracking"); + + if (locationClient != null && locationClient.isConnected()) { + Location location = locationClient.getLastLocation(); + longitudeTextView.setText("longitude: " + location.getLongitude()); + latitudeTextView.setText("latitude: " + location.getLatitude()); + + accuracyTextView.setText("accuracy: " + location.getAccuracy()); + providerTextView.setText("provider: " + location.getProvider()); + timeStampTextView.setText("timeStamp: " + location.getTime()); + } + } + + // called when startTrackingButton is tapped + public void stopTracking(View v) { + Log.e("GpsTrackerActivity", "stopTracking"); + ((Button) v).setText("start tracking"); + + } + + @Override + protected void onStart() { + super.onStart(); + // Connect the client. + //mLocationClient.connect(); + } + + @Override + protected void onStop() { + // Disconnecting the client invalidates it. + //mLocationClient.disconnect(); + super.onStop(); + } + + @Override + public void onLocationChanged(Location location) { + + // LocationUtils.getLatLng(this, 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) { + + } + + /** + * Called by Location Services if the connection to the + * location client drops because of an error. + */ + @Override + public void onDisconnected() { + + } + + @Override + public void onConnectionFailed(ConnectionResult connectionResult) { + + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + + // Inflate the menu; this adds items to the action bar if it is present. + 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); + } + + /** + * A placeholder fragment containing a simple view. + */ + 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); + + return rootView; + } + } + +} diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..55621cc --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png Binary files differ diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..11ec206 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png Binary files differ diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..7c02b78 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png Binary files differ diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..915d914 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png Binary files differ diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/layout/activity_gpstracker.xml b/phoneClients/android/Android/GpsTracker/src/main/res/layout/activity_gpstracker.xml new file mode 100644 index 0000000..33784e1 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/layout/activity_gpstracker.xml @@ -0,0 +1,7 @@ + diff --git a/phoneClients/android/Android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml b/phoneClients/android/Android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml new file mode 100644 index 0000000..b8cd5d7 --- /dev/null +++ b/phoneClients/android/Android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + +