O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collecting location information

If we don't have access to this location information, we will use a simple approach of displaying a dialog to the user. There the user can provide the required information:

else 
{ 
   try 
   { 
         await MainPage.Instance.Dispatcher.RunAsync( 
               CoreDispatcherPriority.Normal, async () => 
         { 
               try 
               { 
                     RegistrationDialog Dialog = new RegistrationDialog(); 
 
                     switch (await Dialog.ShowAsync()) 
                     {

If the user fills in the form and presses the Register button, the information is persisted to be used the next time the device is restarted. If the user presses the Cancel button, the registration process starts again (since registration in our simple example is required). The form included in the projects looks like the one shown in the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required