diff --git a/Lesson_203/FullSolution/MainPage.xaml.cs b/Lesson_203/FullSolution/MainPage.xaml.cs
index 4fa446d..6b2cc43 100644
--- a/Lesson_203/FullSolution/MainPage.xaml.cs
+++ b/Lesson_203/FullSolution/MainPage.xaml.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
+using System.Net.Http;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
@@ -26,6 +27,9 @@ public MainPage()
protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
{
Debug.WriteLine("MainPage::OnNavigatedTo");
+
+ MakePinWebAPICall();
+
try
{
//Create a new object for our barometric sensor class
@@ -61,5 +65,21 @@ protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
Debug.WriteLine(ex.Message);
}
}
+
+ ///
+ // This will put your pin on the world map of makers using this lesson.
+ // Microsoft will receive the IP address of your Raspberry Pi2
+ // this will be used to determine the rough geographic location of the device, in
+ // latitude and longitude. This information will be stored for use in generating the
+ // pin map showing the location of people who have also run this sample.
+ // This data will not be shared with any outside party.
+ ///
+ public void MakePinWebAPICall()
+ {
+ HttpClient client = new HttpClient();
+
+ // Comment this line to opt out of the pin map.
+ client.GetStringAsync("http://adafruitsample.azurewebsites.net/api?Lesson=203");
+ }
}
}
diff --git a/Lesson_203/StartSolution/MainPage.xaml.cs b/Lesson_203/StartSolution/MainPage.xaml.cs
index 856b4fb..281417c 100644
--- a/Lesson_203/StartSolution/MainPage.xaml.cs
+++ b/Lesson_203/StartSolution/MainPage.xaml.cs
@@ -26,6 +26,8 @@ public MainPage()
protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
{
Debug.WriteLine("MainPage::OnNavigatedTo");
+
+ MakePinWebAPICall();
try
{
//Create a new object for our barometric sensor class
@@ -50,5 +52,21 @@ protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
Debug.WriteLine(ex.Message);
}
}
+
+ ///
+ // This will put your pin on the world map of makers using this lesson.
+ // Microsoft will receive the IP address of your Raspberry Pi2
+ // this will be used to determine the rough geographic location of the device, in
+ // latitude and longitude. This information will be stored for use in generating the
+ // pin map showing the location of people who have also run this sample.
+ // This data will not be shared with any outside party.
+ ///
+ public void MakePinWebAPICall()
+ {
+ HttpClient client = new HttpClient();
+
+ // Comment this line to opt out of the pin map.
+ client.GetStringAsync("http://adafruitsample.azurewebsites.net/api?Lesson=203");
+ }
}
}
diff --git a/Lesson_205/FullSolution/MainPage.xaml.cs b/Lesson_205/FullSolution/MainPage.xaml.cs
index f88453d..bf26595 100644
--- a/Lesson_205/FullSolution/MainPage.xaml.cs
+++ b/Lesson_205/FullSolution/MainPage.xaml.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
+using System.Net.Http;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Windows.Devices.Gpio;
@@ -33,6 +34,8 @@ public MainPage()
protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
{
+ MakePinWebAPICall();
+
try
{
//Create a new object for the color sensor class
@@ -97,6 +100,22 @@ private async Task SpeakColor(string colorRead)
audio.Play();
});
}
+
+ ///
+ // This will put your pin on the world map of makers using this lesson.
+ // Microsoft will receive the IP address of your Raspberry Pi2
+ // this will be used to determine the rough geographic location of the device, in
+ // latitude and longitude. This information will be stored for use in generating the
+ // pin map showing the location of people who have also run this sample.
+ // This data will not be shared with any outside party.
+ ///
+ public void MakePinWebAPICall()
+ {
+ HttpClient client = new HttpClient();
+
+ // Comment this line to opt out of the pin map.
+ client.GetStringAsync("http://adafruitsample.azurewebsites.net/api?Lesson=205");
+ }
}
}
diff --git a/Lesson_205/StartSolution/MainPage.xaml.cs b/Lesson_205/StartSolution/MainPage.xaml.cs
index f426677..a6b238d 100644
--- a/Lesson_205/StartSolution/MainPage.xaml.cs
+++ b/Lesson_205/StartSolution/MainPage.xaml.cs
@@ -34,6 +34,8 @@ public MainPage()
protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
{
+ MakePinWebAPICall();
+
try
{
//Create a new object for the color sensor class
@@ -98,6 +100,22 @@ private async Task SpeakColor(string colorRead)
});
}
+
+ ///
+ // This will put your pin on the world map of makers using this lesson.
+ // Microsoft will receive the IP address of your Raspberry Pi2
+ // this will be used to determine the rough geographic location of the device, in
+ // latitude and longitude. This information will be stored for use in generating the
+ // pin map showing the location of people who have also run this sample.
+ // This data will not be shared with any outside party.
+ ///
+ public void MakePinWebAPICall()
+ {
+ HttpClient client = new HttpClient();
+
+ // Comment this line to opt out of the pin map.
+ client.GetStringAsync("http://adafruitsample.azurewebsites.net/api?Lesson=205");
+ }
}
}