diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml
index a8e1f9e..580902a 100644
--- a/phoneClients/android/.idea/workspace.xml
+++ b/phoneClients/android/.idea/workspace.xml
@@ -41,6 +41,12 @@
+
+
+
+
+
+
@@ -107,54 +113,28 @@
-
-
+
+
-
-
-
-
-
-
-
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -604,7 +584,7 @@
-
+
-
+
-
-
+
+
@@ -1003,7 +983,7 @@
-
+
@@ -1018,8 +998,6 @@
-
-
@@ -1193,6 +1171,8 @@
+
+
@@ -1442,13 +1422,12 @@
-
+
-
@@ -1458,19 +1437,20 @@
-
+
-
+
+
@@ -1541,13 +1521,8 @@
-
-
-
-
-
-
-
+
+
@@ -1564,13 +1539,8 @@
-
-
-
-
-
-
-
+
+
@@ -1580,13 +1550,8 @@
-
-
-
-
-
-
-
+
+
@@ -1603,13 +1568,8 @@
-
-
-
-
-
-
-
+
+
@@ -1633,13 +1593,8 @@
-
-
-
-
-
-
-
+
+
@@ -1699,13 +1654,8 @@
-
-
-
-
-
-
-
+
+
@@ -1727,13 +1677,8 @@
-
-
-
-
-
-
-
+
+
@@ -1755,13 +1700,8 @@
-
-
-
-
-
-
-
+
+
@@ -1783,13 +1723,8 @@
-
-
-
-
-
-
-
+
+
@@ -1920,7 +1855,6 @@
-
@@ -1928,7 +1862,6 @@
-
@@ -1936,7 +1869,6 @@
-
@@ -1948,8 +1880,8 @@
-
-
+
+
@@ -1970,26 +1902,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1997,34 +1909,46 @@
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phoneClients/android/app/app.iml b/phoneClients/android/app/app.iml
index ecd391d..6496d8c 100644
--- a/phoneClients/android/app/app.iml
+++ b/phoneClients/android/app/app.iml
@@ -13,6 +13,7 @@
+
@@ -37,22 +38,22 @@
+
-
+
-
+
-
diff --git a/phoneClients/android/app/build.gradle b/phoneClients/android/app/build.gradle
index 55fdb4d..a901d36 100644
--- a/phoneClients/android/app/build.gradle
+++ b/phoneClients/android/app/build.gradle
@@ -8,8 +8,8 @@
applicationId "com.websmithing.gpstracker"
minSdkVersion 10
targetSdkVersion 20
- versionCode 9
- versionName "3.2.9"
+ versionCode 10
+ versionName "3.3.0"
}
buildTypes {
release {
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
index bd092f6..267cb01 100644
--- a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java
@@ -57,6 +57,15 @@
SharedPreferences sharedPreferences = this.getSharedPreferences("com.websmithing.gpstracker.prefs", Context.MODE_PRIVATE);
currentlyTracking = sharedPreferences.getBoolean("currentlyTracking", false);
+ boolean firstTimeLoadindApp = sharedPreferences.getBoolean("firstTimeLoadindApp", true);
+ if (firstTimeLoadindApp) {
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putBoolean("firstTimeLoadindApp", false);
+ editor.putString("appID", UUID.randomUUID().toString());
+ editor.apply();
+ }
+
+
intervalRadioGroup.setOnCheckedChangeListener(
new RadioGroup.OnCheckedChangeListener() {
@Override
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
index d10ad9b..0f38f13 100644
--- a/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
+++ b/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
@@ -122,7 +122,7 @@
}
requestParams.put("username", sharedPreferences.getString("userName", ""));
- requestParams.put("phonenumber", "867-5309"); // not being used but is fully functional
+ requestParams.put("phonenumber", sharedPreferences.getString("appID", "")); // uuid
requestParams.put("sessionid", sharedPreferences.getString("sessionID", "")); // uuid
Double accuracyInFeet = location.getAccuracy()* 3.28;
diff --git a/phoneClients/android/build/intermediates/model_data.bin b/phoneClients/android/build/intermediates/model_data.bin
index 19b37e2..959946e 100644
--- a/phoneClients/android/build/intermediates/model_data.bin
+++ b/phoneClients/android/build/intermediates/model_data.bin
Binary files differ
diff --git a/phoneClients/ios/GpsTracker/WSViewController.m b/phoneClients/ios/GpsTracker/WSViewController.m
index decb031..f25849a 100644
--- a/phoneClients/ios/GpsTracker/WSViewController.m
+++ b/phoneClients/ios/GpsTracker/WSViewController.m
@@ -30,17 +30,21 @@
NSDate *lastWebsiteUpdateTime;
int timeIntervalInSeconds;
bool increasedAccuracy;
+ NSString *defaultUploadWebsite;
}
- (void)viewDidLoad
{
[super viewDidLoad];
+ // use the websmithing defaultUploadWebsite for testing, change the userName parameter to something you
+ // know and then check your location with your browser here: https://www.websmithing.com/gpstracker/displaymap.php
+
+ defaultUploadWebsite = @"https://www.websmithing.com/gpstracker/updatelocation.php";
+ self.uploadWebsiteTextField.text = defaultUploadWebsite;
+
[self.trackingButton setButtonColor:@"#ff0033" andHighLightColor:@"#ff7691" andTextColor:@"#FFFFFF" andHighlightTextColor:@"#333333"];
-
- // here is the red color, #ff0033 and its highlight, #ff7691
- // here is the green color, #33ffcc and it's highlight, #a9ffe9
-
+
currentlyTracking = NO;
timeIntervalInSeconds = 60; // change this to the time interval you want
}
@@ -52,7 +56,7 @@
locationManager = [[CLLocationManager alloc] init];
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
locationManager.distanceFilter = 0; // meters
- //locationManager.pausesLocationUpdatesAutomatically = NO; // YES is default
+ locationManager.pausesLocationUpdatesAutomatically = NO; // YES is default
locationManager.activityType = CLActivityTypeAutomotiveNavigation;
locationManager.delegate = self;
@@ -65,6 +69,9 @@
[locationManager startUpdatingLocation];
}
+
+
+
- (void)stopTracking
{
NSLog(@"stop tracking");
@@ -73,10 +80,27 @@
locationManager = nil;
}
+- (void)checkTextFields {
+ NSLog(@"check Text Fields");
+
+ NSString *uploadWebsite = [self.uploadWebsiteTextField.text stringByTrimmingCharactersInSet:
+ [NSCharacterSet whitespaceCharacterSet]];
+
+ NSString *userName = [self.userNameTextField.text stringByTrimmingCharactersInSet:
+ [NSCharacterSet whitespaceCharacterSet]];
+
+ if (uploadWebsite.length == 0 || userName.length == 0) {
+ NSLog(@"make your user name longer.");
+ } else {
+ NSLog(@"it's ok.");
+ }
+
+}
+
- (IBAction)handleTrackingButton:(id)sender
{
if (currentlyTracking) {
- //[self stopTracking];
+ [self stopTracking];
currentlyTracking = NO;
// set to RED
@@ -88,16 +112,14 @@
[self.trackingButton setTitle:@"Tracking is Off" forState:UIControlStateNormal];
} else {
- //[self startTracking];
+ [self startTracking];
currentlyTracking = YES;
+ [self checkTextFields];
+
// set to GREEN
[self.trackingButton setButtonColor:@"#33ffcc" andHighLightColor:@"#a9ffe9" andTextColor:@"#000000" andHighlightTextColor:@"#999999"];
[self.trackingButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- // here is the red color, #ff0033 and its highlight, #ff7691
- // here is the green color, #33ffcc and it's highlight, #a9ffe9
-
[self.trackingButton setTitle:@"Tracking is On" forState:UIControlStateNormal];
}
}
@@ -126,7 +148,7 @@
NSTimeInterval secondsSinceLastWebsiteUpdate = fabs([lastWebsiteUpdateTime timeIntervalSinceNow]);
if (firstTimeGettingPosition || (secondsSinceLastWebsiteUpdate > timeIntervalInSeconds)) { // currently one minute
- if (location.horizontalAccuracy < 100.0 && location.coordinate.latitude != 0 && location.coordinate.longitude != 0) {
+ if (location.horizontalAccuracy < 500.0 && location.coordinate.latitude != 0 && location.coordinate.longitude != 0) {
if (increasedAccuracy) {
[self reduceTrackingAccuracy];
@@ -174,10 +196,7 @@
- (void)updateWebsiteWithLatitde:(NSString *)latitude longitude:(NSString *)longitude speed:(NSString *)speed date:(NSString *)date distance:(NSString *)distance sessionID:(NSString *)sessionID accuracy:(NSString *)accuracy extraInfo:(NSString *)extraInfo direction:(NSString *)direction
{
- // 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
-
- NSString *defaultUploadWebsite = @"https://www.websmithing.com/gpstracker/updatelocation.php";
+
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
@@ -188,7 +207,8 @@
@"date": date,
@"locationmethod": @"n/a",
@"distance": distance,
- @"phonenumber": @"iosUser",
+ @"username": @"iosUser137",
+ @"phonenumber": @"iosUser137",
@"sessionid": sessionID,
@"extrainfo": extraInfo,
@"accuracy": accuracy,