ENG [#IOT] Different behaviors for an App based on the app architecture (9 on N) #RaspberryPi2 #Windows10


New post for Windows 10 and Raspberry Pi 2 series

  1. Hardware and software (1 on N)
  2. Boot from SD card in the device (2 of N)
  3. Hello World mode! (3 of N)
  4. Visual Studio deployment process and Web Management app (4 on N)
  5. Hello Blinky !!! (5 on N)
  6. Some admin tasks, like change password and change name (6 on N)
  7. List of connected devices in the Raspberry Pi 2 (7 on N)
  8. Deploy an app using the deploy package (8 on N)
  9. Different behaviors for an App based on the app architecture

If you’re an old school developer when you find a change one of the oldest APIs, for sure you’ll suffer a heart attack. That’s what happened with the classical System.Environment. The following image shows the difference that we have between a classic WPF app with .net 4.5 and a Universal App for Windows 10.


Now a Universal App will execute in a controlled environment (Sandbox), whether on a laptop, a smartphone or a device. This implies that the app capabilities are tied to this Sandbox. For example, what formerly used to get from the Environment, now perhaps we must look for it in the Package of the application. The architecture of the processor is an example, and the following code shows an example to validate if the app is running on an ARM processor.


While the idea behind Universal Apps is to have the maximum code unified for all platforms, should take into account the capabilities of each platform. For example, in ARM we don’t have the possibility to use MessageDialogs so if we want to show a message we have to do a bit of defensive programming .


This allows us to display a message in the mode dialog on a laptop or tablet


And for the case of ARM, the message in a TextBlock as part of the app.


The sample code on github


Saludos @ Madrid

/El Bruno


Environment.Is64BitProcess, https://msdn.microsoft.com/en-us/library/system.environment.is64bitprocess(VS.100).aspx

MessageDialog, https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.popups.messagedialog.aspx


Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: