From b4581952e9549ecfb67f49f8681c342290f06fc3 Mon Sep 17 00:00:00 2001 From: HaishiBai Date: Thu, 7 Apr 2016 16:17:41 -0700 Subject: [PATCH 1/6] Fixed moible app deployment problem --- scripts/ARM/scenario_complete.json | 4 +++- scripts/ARM/scenario_complete.nocomments.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ARM/scenario_complete.json b/scripts/ARM/scenario_complete.json index 30fd7b47..57ab1b3d 100644 --- a/scripts/ARM/scenario_complete.json +++ b/scripts/ARM/scenario_complete.json @@ -102,6 +102,7 @@ /* Mobile App settings */ "mobileAppName": "[concat(variables('baseName'), '-', uniquestring(resourceGroup().id))]", "mobileAppRepositoryBranch": "master", + "mobileAppProject": "src/MobileAppService/MyDrivingService/MyDrivingService.csproj", /* App Insights settings */ "appInsightsName": "[concat(variables('baseName'), 'API', '-', uniquestring(resourceGroup().id))]", "appInsightsLocation": "centralus", /* App Insights is currently only available in Central US */ @@ -550,7 +551,8 @@ "[resourceId('Microsoft.Web/Sites', variables('mobileAppName'))]" ], "properties": { - "IoTHubConnectionString": "[concat('HostName=', variables('iotHubName'), '.azure-devices.net;SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listKeys(resourceId('Microsoft.Devices/IotHubs/Iothubkeys', variables('iotHubName'), variables('iotHubKeyName')), '2016-02-03').primaryKey)]" + "IoTHubConnectionString": "[concat('HostName=', variables('iotHubName'), '.azure-devices.net;SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listKeys(resourceId('Microsoft.Devices/IotHubs/Iothubkeys', variables('iotHubName'), variables('iotHubKeyName')), '2016-02-03').primaryKey)]", + "Project": "[variables('mobileAppProject')]" } }, { diff --git a/scripts/ARM/scenario_complete.nocomments.json b/scripts/ARM/scenario_complete.nocomments.json index 0e99439f..dfa85c8d 100644 --- a/scripts/ARM/scenario_complete.nocomments.json +++ b/scripts/ARM/scenario_complete.nocomments.json @@ -93,6 +93,7 @@ "hostingPlanName": "[concat(variables('baseName'), 'Plan', '-', uniquestring(resourceGroup().id))]", "mobileAppName": "[concat(variables('baseName'), '-', uniquestring(resourceGroup().id))]", "mobileAppRepositoryBranch": "master", + "mobileAppProject": "src/MobileAppService/MyDrivingService/MyDrivingService.csproj", "appInsightsName": "[concat(variables('baseName'), 'API', '-', uniquestring(resourceGroup().id))]", "appInsightsLocation": "centralus", "dataFactoryName": "[concat(variables('baseName'), '-df', uniquestring(resourceGroup().id))]", @@ -521,7 +522,8 @@ "[resourceId('Microsoft.Web/Sites', variables('mobileAppName'))]" ], "properties": { - "IoTHubConnectionString": "[concat('HostName=', variables('iotHubName'), '.azure-devices.net;SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listKeys(resourceId('Microsoft.Devices/IotHubs/Iothubkeys', variables('iotHubName'), variables('iotHubKeyName')), '2016-02-03').primaryKey)]" + "IoTHubConnectionString": "[concat('HostName=', variables('iotHubName'), '.azure-devices.net;SharedAccessKeyName=', variables('iotHubKeyName'), ';SharedAccessKey=', listKeys(resourceId('Microsoft.Devices/IotHubs/Iothubkeys', variables('iotHubName'), variables('iotHubKeyName')), '2016-02-03').primaryKey)]", + "Project": "[variables('mobileAppProject')]" } }, { From 3a01b1f5baf0c2c8cbe0b727df8f9c712dcd3721 Mon Sep 17 00:00:00 2001 From: "Vaijanath Angadihiremath(VJ)" Date: Fri, 8 Apr 2016 14:54:42 -0700 Subject: [PATCH 2/6] Fix for intermittent crash when creating ExtendedExecutionSessoin to run the app in background. Now if the creation fails then we simply notify user that the creation failed. --- .../MyDriving.UWP/MyDriving.UWP.csproj | 2 +- .../Views/CurrentTripView.xaml.cs | 46 +++++++++++-------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj b/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj index f1e5c9c4..0ad4b6a7 100644 --- a/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj +++ b/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj @@ -400,7 +400,7 @@ Visual C++ 2015 Runtime for Universal Windows Platform Apps - + SQLite for Universal Windows Platform diff --git a/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs b/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs index 90c74ea6..a6e603d4 100644 --- a/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs +++ b/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs @@ -184,28 +184,38 @@ private async Task BeginExtendedExecution() ClearExtendedExecution(); - var newSession = new ExtendedExecutionSession + try { - Reason = ExtendedExecutionReason.LocationTracking, - Description = "Tracking your location" - }; - newSession.Revoked += SessionRevoked; - ExtendedExecutionResult result = await newSession.RequestExtensionAsync(); - switch (result) - { - case ExtendedExecutionResult.Allowed: - session = newSession; - ViewModel.Geolocator.AllowsBackgroundUpdates = true; - ViewModel.StartTrackingTripCommand.Execute(null); + var newSession = new ExtendedExecutionSession + { + Reason = ExtendedExecutionReason.LocationTracking, + Description = "Tracking your location" + }; + newSession.Revoked += SessionRevoked; + ExtendedExecutionResult result = await newSession.RequestExtensionAsync(); + switch (result) + { + case ExtendedExecutionResult.Allowed: + session = newSession; + ViewModel.Geolocator.AllowsBackgroundUpdates = true; + ViewModel.StartTrackingTripCommand.Execute(null); - break; + break; - default: - Acr.UserDialogs.UserDialogs.Instance.Alert("Unable to execute app in the background.", - "Background execution denied.", "OK"); + default: + Acr.UserDialogs.UserDialogs.Instance.Alert("Unable to execute app in the background.", + "Background execution denied.", "OK"); - newSession.Dispose(); - break; + newSession.Dispose(); + break; + } + } + catch (Exception ex) + { + // Sometimes while creating ExtendedExecution session you get Resource not ready exception. + Logger.Instance.Report(ex); + Acr.UserDialogs.UserDialogs.Instance.Alert("Will not be able to execute app in the background.", + "Background execution session failed.", "OK"); } } From 218855f51d9440cd59a655f9989a64432eab40c2 Mon Sep 17 00:00:00 2001 From: "Vaijanath Angadihiremath(VJ)" Date: Fri, 8 Apr 2016 16:45:49 -0700 Subject: [PATCH 3/6] FIxing Object reference is not set to null exception from April 7 th hockey app crash analysis. --- .../MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs b/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs index a6e603d4..2a5636dc 100644 --- a/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs +++ b/src/MobileApps/MyDriving/MyDriving.UWP/Views/CurrentTripView.xaml.cs @@ -381,7 +381,7 @@ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => private async void DrawPath(BasicGeoposition basicGeoposition) { - if (!ViewModel.IsRecording || ViewModel.CurrentTrip.Points.Count == 0) + if (!ViewModel.IsRecording || ViewModel.CurrentTrip?.Points?.Count == 0) return; await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => @@ -393,8 +393,12 @@ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Locations = new List( - ViewModel.CurrentTrip.Points.Select( + ViewModel.CurrentTrip?.Points?.Select( s => new BasicGeoposition() { Latitude = s.Latitude, Longitude = s.Longitude })); + + // If the viewmodel still has not added this point, then add it locally to the Locations collection. + if (Locations.Count == 0) + Locations.Add(basicGeoposition); } else Locations.Add(basicGeoposition); From 337acdeada708ad3e0c3f923bbb6c5dc1646f04f Mon Sep 17 00:00:00 2001 From: HaishiBai Date: Sun, 10 Apr 2016 19:10:46 -0700 Subject: [PATCH 4/6] added .deployment file for deploying web app --- .deployment | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .deployment diff --git a/.deployment b/.deployment new file mode 100644 index 00000000..45ccc160 --- /dev/null +++ b/.deployment @@ -0,0 +1,2 @@ +[config] +project=src/MobileAppService/MyDrivingService/MyDrivingService.csproj \ No newline at end of file From ced5ceb2d706df616307200660e3c48cfd051136 Mon Sep 17 00:00:00 2001 From: Nicole Haugen Date: Mon, 11 Apr 2016 16:35:02 -0500 Subject: [PATCH 5/6] Checking if getting items from the POIStore results in exception --- .../MyDriving/ViewModel/CurrentTripViewModel.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/MobileApps/MyDriving/MyDriving/ViewModel/CurrentTripViewModel.cs b/src/MobileApps/MyDriving/MyDriving/ViewModel/CurrentTripViewModel.cs index c4ee26ac..8e53d827 100644 --- a/src/MobileApps/MyDriving/MyDriving/ViewModel/CurrentTripViewModel.cs +++ b/src/MobileApps/MyDriving/MyDriving/ViewModel/CurrentTripViewModel.cs @@ -291,7 +291,19 @@ public async Task StopRecordingTrip() Logger.Instance.Report(ex); } - List poiList = new List(await StoreManager.POIStore.GetItemsAsync(CurrentTrip.Id)); + List poiList = new List(); + try + { + poiList = new List(await StoreManager.POIStore.GetItemsAsync(CurrentTrip.Id)); + } + catch (Exception ex) + { + //Intermittently, Sqlite will cause a crash for WinPhone saying "unable to set temporary directory" + //If this call fails, simply use an empty list of POIs + Logger.Instance.WriteLine("Unable to get POI Store Items."); + Logger.Instance.Report(ex); + } + CurrentTrip.HardStops = poiList.Where(p => p.POIType == POIType.HardBrake).Count(); CurrentTrip.HardAccelerations = poiList.Where(p => p.POIType == POIType.HardAcceleration).Count(); From 7f1df3bbfb389253059f2adfa2ce5d60e6c04b6a Mon Sep 17 00:00:00 2001 From: "Vaijanath Angadihiremath(VJ)" Date: Mon, 11 Apr 2016 16:07:29 -0700 Subject: [PATCH 6/6] Updating the SQLite for Universal Windows Platform to latest version. --- src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj b/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj index 0ad4b6a7..d3f341a4 100644 --- a/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj +++ b/src/MobileApps/MyDriving/MyDriving.UWP/MyDriving.UWP.csproj @@ -400,7 +400,7 @@ Visual C++ 2015 Runtime for Universal Windows Platform Apps - + SQLite for Universal Windows Platform