About Matthijs Hoekstra

Posts by Matthijs Hoekstra:

BUILD 2017 videos from Windows (UWP)

As every year, Windows was a big part of BUILD. For convenience (and my own) I listed all recorded and pre-recorded sessions from Windows below. Enjoy (Click the title of the session to go to the Channel9 page).

Breakout Session Title Speakers
App Model evolution Andrew Clinick
What’s new in the Microsoft Design Language Bojana Ostojic; Paul Gusmorino
Build Amazing Apps with Fluent Design James Clarke;Paul Gusmorino
What’s new and coming for Windows UI: XAML and composition Ashish Shetty; Tim Heuer
Bring your desktop apps to UWP and the Windows Store using the Desktop Bridge John Sheehan;Peyman Zanjani
Windows Ink and Microsoft Surface Dial David Abzarian;Sha Viswanathan
Cross-device and cross-platform experiences with Project Rome and Microsoft Graph Vikas Bhatia;Carmen Forsmann
App engagement in Windows and Cortana with User Activities and Project Rome Shawn Henry;Juan Oviedo
XAML custom controls for UWP: Start to finish

Nikola Metulev

John Bristowe (Telerik)

Explore the next generation of innovative UI in the Visual Layer

Kelly Renner

Lindsay Kubasik

Tip, tricks, and secrets: Building a great UWP app for PC

Stefan Wick

Ginny Caughey

Modernize Win32 apps with maximum code reuse, cross-platform reach, and efficient DevOps

Mike Battista

Joshua Weber

Introducing Adaptive Cards

Matt Hidinger

Lei Xu

What’s new in Xamarin.Forms

David Ortinau

Jason Smith

Microsoft Edge: What’s new and what’s next for the web and web apps on Windows

Kyle Pflug

Nadia Fortini

Progressive web apps and the Windows ecosystem Aaron Gustafson
Ten things you didn’t know about Visual Studio 2017 for building .NET UWP apps

Daniel Jacobson

Clint Rutkas

Using the Windows Subsystem for Linux and the Windows Console for a next gen dev experience

Gilles Khouzam

Jack Hammons

Windows Store: Manage and promote apps your way

Bernardo Zamora

Jonathan Garrigues

Proven tips for a successful Windows Store app

Jaime Rodriguez

Sonia Carlson

Nextgen UWP app distribution: Building extensible, stream-able, componentized apps

John Vintzel

Sandeep Mathew George

Connected intelligent things with Windows IoT Core and Azure IoT 

Rushmi Malaviarachchi

Sam George

The road to commercialization for your Windows IoT solution  Jason Farmer
Unity and Windows holographic tooling and intro to mixed reality Mark Schoennagel (Unity)
State of play: Modern game development

Andrew Parsons

James Yarrow

Windows 10 identity overview

Matthew Palko

Yogesh Mehta

Developing on Windows Server:  Containers, Docker, .NET Core, Service Fabric, and more

Steve Lasker

Taylor Brown

 

 

 

Recorded Session Title Speakers
IoT Studio: Development of apps that can control OCF devices Luiz Felipe Lage Campos Tenaglia; Srikrishna Gurugubelli
Bridges to UWP for Retail Point-of-Sale Application Developers Marcus Breda; Terry Warwick
Advancing commerce: Bring a fast and easy checkout experience to your customers across the web, UWP platform, and bots Jonathan Cutler; Molly Dalton; Stan Chang
My People on the Taskbar is a Window to Your App Allison O’Mahony; Tony Pendolino
Collect and analyze crashes for your Windows apps using the Visual Studio Mobile Center Ela Malani; Francis Zhou
Lighting up HDR and advanced color in Microsoft DirectX Simon Tao
Desktop Bridge: Smooth user transition and migration Arian Ghotbi
Introduction to Windows 10 Accessibility Jeff Petty
Vector Iconography: Using SVG images in your app Rick Manning
OpenType variable fonts: How to use fewer fonts and get a lot more typographic richness Peter Constable; Shrinath Shanbhag
WinAppDriver Yosef Durr
No more blurriness: Making your desktop application render crisply on high DPI displays James Clarke; Peter Felts
Beyond App Containers: Gaining privileged access to hardware inside your Windows app using custom capabilities Ben McGregor; Viraf Gandhi
Innovate faster with Windows as a Service (WaaS) Ethel Garcia Simon Matachana; Steve DiAcetis
WebVR: Adding VR to your websites and web apps David Rousset; Etienne Margraff
Production tracing with Event Tracing for Windows (ETW) Doug Cook
Surface Dial: What’s new for developers in the Creators Update Connor Weins
File Access Improvements in UWP Apps Adam Wilson; Steve Maillet
A quick lap around Microsoft Monetization Platform Kiran Bangalore
Bot Conversations for Apps Khuram Shahid
Go big! Optimizing your applications for large screen experiences  Mark Rideout
Maximizing user engagement and conversions with customized app content Yamil Hernandez
Dev Center analytics for Win32 applications Sonia Carlson
How to add an in-app purchase flow to your desktop app leveraging the Desktop Bridge Vladimir Postel
Microsoft’s Universal User Acquisition Platform Anusha Subramanian
Xbox Live Creators Program Mehmet Erkilic
Enable natural pen interaction by using Ink Analysis to better understand users’ ink Jianfeng Lin
Maximizing revenue through advanced pricing, sales and scheduling configuration in Dev Center Bernardo Zamora
App Diagnostics #1 – The New APIs Andrew Whitechapel
App Diagnostics #2: App Profiling Andrew Whitechapel
Windows 10 on ARM Hari Pulapaka
What’s new for multi-tasking in UWP? Chris Cortes
Tips and Tricks for Creating Performant UI in UWP David Li; Robert Mikhayelyan
Bluetooth 1: Intro to Bluetooth Explorer Frank Gorgenyi; Steffen Froehlich
Bluetooth 2: Unpaired Bluetooth LE device connectivity Frank Gorgenyi
Bluetooth 3: Bluetooth GATT Server in Windows 10  Frank Gorgenyi

How to enable IPV6 from Comcast on your UniFi Security Gateway

Since a while I run my home network on Unify hardware. I have got the UniFi security Gateway 3P, 1 (but soon 2) UniFi AP-AC-Pro and a UniFi Switch 8 POE-150W. Of course a Cloud key to manage it all (so I don’t need to install Java on my PC).

So far there is no way to configure IPv6 through the UI, it’s on the roadmap though. But you can very easily set it up through the command line or through provisioning a configuration file. I have been searching in the forum and found several posts explaining how to do it but neither seemed to work 100% or perhaps I did something wrong.

The easiest is go through the command line. Make an SSH connection to you USG. I use Bash on Windows to be able to use SSH.

ssh adminname@192.168.1.1 (type yes if this is the first time you connect) enter your password to login to your gateway. You can enter show configuration to see what the current configuration is.

run the configure command and than run the following commands (I assume eth0 is your WAN connection with Comcast and eth1 is your internal LAN):

set interfaces ethernet eth0 dhcpv6-pd pd 0
set interfaces ethernet eth0 dhcpv6-pd pd 0 interface eth1
set interfaces ethernet eth0 dhcpv6-pd pd 0 prefix-length 64
set interfaces ethernet eth1 ipv6 router-advert prefix ::/64
set interfaces ethernet eth1 ipv6 router-advert managed-flag true
set interfaces ethernet eth1 ipv6 router-advert send-advert true

then enter the command commit

You will see some messages about Re-generating radvd config file for eth1… and Re-starting radvd: radvd.

type the command save

The next thing you might want to do is setup some firewall rules so you won’t expose all your machines with an ipv6 address directly to the internet. The following commands need to be entered in configuration mode again:

set firewall ipv6-name wan_in-6 default-action drop
set firewall ipv6-name wan_in-6 description wan_in
set firewall ipv6-name wan_in-6 enable-default-log
set firewall ipv6-name wan_in-6 rule 1 action accept
set firewall ipv6-name wan_in-6 rule 1 state established enable
set firewall ipv6-name wan_in-6 rule 1 state related enable
set firewall ipv6-name wan_in-6 rule 1 description “Allow Enabled/Related state”
set firewall ipv6-name wan_in-6 rule 2 action drop
set firewall ipv6-name wan_in-6 rule 2 log enable
set firewall ipv6-name wan_in-6 rule 2 state invalid enable
set firewall ipv6-name wan_in-6 rule 2 description “Drop Invalid state”
set firewall ipv6-name wan_in-6 rule 5 action accept
set firewall ipv6-name wan_in-6 rule 5 log enable
set firewall ipv6-name wan_in-6 rule 5 protocol icmpv6
set firewall ipv6-name wan_in-6 rule 5 description “Allow ICMPv6”
set firewall ipv6-name wan_local-6 default-action drop
set firewall ipv6-name wan_local-6 description wan_local
set firewall ipv6-name wan_local-6 enable-default-log
set firewall ipv6-name wan_local-6 rule 1 action accept
set firewall ipv6-name wan_local-6 rule 1 state established enable
set firewall ipv6-name wan_local-6 rule 1 state related enable
set firewall ipv6-name wan_local-6 rule 1 description “Allow Enabled/Related state”
set firewall ipv6-name wan_local-6 rule 2 action drop
set firewall ipv6-name wan_local-6 rule 2 log enable
set firewall ipv6-name wan_local-6 rule 2 state invalid enable
set firewall ipv6-name wan_local-6 rule 2 description “Drop Invalid state”
set firewall ipv6-name wan_local-6 rule 5 action accept
set firewall ipv6-name wan_local-6 rule 5 log enable
set firewall ipv6-name wan_local-6 rule 5 protocol icmpv6
set firewall ipv6-name wan_local-6 rule 5 description “Allow ICMPv6”
set firewall ipv6-name wan_local-6 rule 6 description “DHCPv6”
set firewall ipv6-name wan_local-6 rule 6 action accept
set firewall ipv6-name wan_local-6 rule 6 destination port 546
set firewall ipv6-name wan_local-6 rule 6 protocol udp
set firewall ipv6-name wan_local-6 rule 6 source port 547
set interfaces ethernet eth0 firewall in ipv6-name wan_in-6
set interfaces ethernet eth0 firewall local ipv6-name wan_local-6

commit and save again and you should be all set.

You can check if you received an ipv6 address by typing show interfaces

matthijs@ubnt:~$ show interfaces
Codes: S – State, L – Link, u – Up, D – Down, A – Admin Down
Interface    IP Address                        S/L  Description
———    ———-                        —  ———–
eth0         73.225.151.24/23                  u/u
             2001:558:600a:31:521:e2b9:f034:96f8/128
eth1         192.168.1.1/24                    u/u
             2601:600:8701:1880:822a:a8ff:fef0:a49/60
eth2         –                                 A/D
imq0         –                                 u/D
lo           127.0.0.1/8                       u/u
             ::1/128

And if you have an ipv6 address you can test the connection by using ping6 www.netflix.com

matthijs@ubnt:~$ ping6 www.netflix.com
PING www.netflix.com(2620:108:700f::3425:db06) 56 data bytes
64 bytes from 2620:108:700f::3425:db06: icmp_seq=1 ttl=44 time=30.7 ms
64 bytes from 2620:108:700f::3425:db06: icmp_seq=2 ttl=44 time=33.3 ms
^C
— www.netflix.com ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 30.740/32.035/33.331/1.307 ms

Another way to provision your USG is by creating a config.gateway.json file with your settings and place it in the /srv/unifi/data/sites/default directory on your cloudkey. (or equivalent directory when you are using the management software on another system like Windows or your Mac). You need to trigger a provisioning of your USG to make this configuration happen. This can be done by changing the HDCP lease range from 192.168.1.254 to 192.168.1.253 for example and save the configuration change. The provisioning will merge the USG configuration with the configuration in the json file.

This is the configuration file with the changes done through the command line:

{
        “firewall”: {
                “ipv6-name”: {
                        “wan_in-6”: {
                                “default-action”: “drop”,
                                “description”: “wan_in”,
                                “enable-default-log”: “””,
                                “rule”: {
                                        “1”: {
                                                “action”: “accept”,
                                                “description”: “Allow Enabled/Related state”,
                                                “state”: {
                                                        “established”: “enable”,
                                                        “related”: “enable”
                                                }
                                        },
                                        “2”: {
                                                “action”: “drop”,
                                                “description”: “Drop Invalid state”,
                                                “log”: “enable”,
                                                “state”: {
                                                        “invalid”: “enable”
                                                }
                                        },
                                        “5”: {
                                                “action”: “accept”,
                                                “description”: “Allow ICMPv6”,
                                                “log”: “enable”,
                                                “protocol”: “icmpv6”
                                        }
                                }
                        },
                        “wan_local-6”: {
                                “default-action”: “drop”,
                                “description”: “wan_local”,
                                “enable-default-log”: “””,
                                “rule”: {
                                        “1”: {
                                                “action”: “accept”,
                                                “description”: “Allow Enabled/Related state”,
                                                “state”: {
                                                        “established”: “enable”,
                                                        “related”: “enable”
                                                }
                                        },
                                        “2”: {
                                                “action”: “drop”,
                                                “description”: “Drop Invalid state”,
                                                “log”: “enable”,
                                                “state”: {
                                                        “invalid”: “enable”
                                                }
                                        },
                                        “5”: {
                                                “action”: “accept”,
                                                “description”: “Allow ICMPv6”,
                                                “log”: “enable”,
                                                “protocol”: “icmpv6”
                                        },
                                        “6”: {
                                                “action”: “accept”,
                                                “description”: “DHCPv6”,
                                                “destination”: {
                                                        “port”: “546”
                                                },
                                                “protocol”: “udp”,
                                                “source”: {
                                                        “port”: “547”
                                                }
                                        }
                                }
                        }
                }
        },
        “interfaces”: {
                “ethernet”: {
                        “eth0”: {
                                “dhcpv6-pd”: {
                                        “pd”: {
                                                “0”: {
                                                        “interface”: {
                                                                “eth1”: “””
                                                        },
                                                        “prefix-length”: “64”
                                                }
                                        },
                                        “rapid-commit”: “enable”
                                },
                                “firewall”: {
                                        “in”: {
                                                “ipv6-name”: “wan_in-6”
                                        },
                                        “local”: {
                                                “ipv6-name”: “wan_local-6”
                                        }
                                }
                        },
                        “eth1”: {
                                “ipv6”: {
                                        “dup-addr-detect-transmits”: “1”,
                                        “router-advert”: {
                                                “cur-hop-limit”: “64”,
                                                “link-mtu”: “0”,
                                                “managed-flag”: “true”,
                                                “max-interval”: “600”,
                                                “other-config-flag”: “false”,
                                                “prefix”: {
                                                        “::/64”: {
                                                                “autonomous-flag”: “true”,
                                                                “on-link-flag”: “true”,
                                                                “valid-lifetime”: “2592000”
                                                        }
                                                },
                                                “reachable-time”: “0”,
                                                “retrans-timer”: “0”,
                                                “send-advert”: “true”
                                        }
                                }
                        }
                }
        }
}

So now you got IPv6 running on your network. You can test if it’s all working (after renewing your ip addresses) here.

This is the post in the forum which helped me fix this in the end.

How to set configuration in your Universal Windows Application through MDM

One thing I hear over and over again when talking to (enterprise) developers is that they struggle with configuration management for UWP applications. In the past they just edited a app.config (or web.config) file on the machines to point an app to a test, acceptance or production environment. In UWP we have a app.config file as well but it’s hidden away in some obscure directory protected by some more restricted ACL.

We do have a solution to configure applications through MDM. It’s pretty bad documented though (which is something we will improve) but I needed to figure this out anyway so I thought I should share my findings.

As you might know we have this concept of data or settings folders in UWP. This is a special place in isolated storage where you can store settings, temporary files, settings which roam, but also configuration. The last one isn’t documented anywhere on MSDN but it does exist. There is a folder called “Managed.App.Settings” which will be created by the system if the MDM server sends out the configuration. I will talk about how to do that a little bit later.

This is how the code looks like to retrieve the configuration inside of your application:

So the code is pretty simple. You try to open up the configuration container. If it is available you retrieve the value, in our example it is ‘Welcome’.

But how do I get this configuration in my system? I got it to work through InTune but every MDM tool should be able to do this. This is done through our EnterpriseModernAppManagement CSP

If you login at https://manage.microsoft.com you go to Policy, Configuration Policies. Click Add, Select Windows\Custom Configuration.

image

You can specify a name and description in the next screen. Save the policy. The next piece is adding the configuration part. So at the OMA-URI Settings section click add. The screen looks like this:

image

You specify a name and a data type. The OMA-URI string needs to be the following for configuration: ./User/Vendor/MSFT/EnterpriseModernAppManagement/AppManagement/AppStore/3441ffd3-6b54-48b0-ac86-accdd148ea0f_f6s3q6fqr0004/AppSettingPolicy/Welcome

And specify a value of your setting in the Value textbox.

The last part if the name of you setting which you use in your code as well. In this sample it’s called Welcome. That translates back to the value we try to get in the Managed.App.Settings container.
The string after the /AppStore/ is the familypackageID you can get from your manifest. That’s how the system knows for what app it needs to store the settings data and in what location.

That’s all. You can have different type of settings, if you need a lot of data you can select the XML value type.

So next step is to try to get this working through the WMI bridge as well. Once I got that to work you should be able to run a powershell script or console app on your desktop to set this configuration as well. I believe that will help you when you have automatic builds, and test deployments in your environment.

Interesting shortcut on Windows: Windows+Ctrl+Shift+B

The advantage of working inside the Windows engineering group is you stumble upon some cool or weird new and old features you never knew about.

One of this nuggets is the keyboard shortcut Windows+Ctrl+Shift+B. So what does it do? It resets the graphics subsystem on your machine (and makes your machine say Beep!).

Apparently this was introduced in the Vista timeframe where we introduced the new Desktop Windows Manager (DWM) in Vista.

Also makes you wonder what other shortcuts are hidden in Windows Winking smile

Auto updater for my side loaded UWP apps

As I described before, i have a few tasks to solve for my home automation project. One of the things I wanted to do is to be able to update my application on the different devices easily. I could publish my home automation app to the store, but it’s hard to provide a test environment for the store testers and it takes a while when the app gets certified before i can roll it out to all my devices. Of course I can sign up for an Intune account and use regular MDM to manage my apps, but 1st i need to have this Intune environment which I think is a bit over the top, and 2nd I would be depending on an internet connection. This is also a topic which comes up with some of my customers so I thought I could solve this differently.

Since the app is going to be side loaded I am allowed to use restricted capabilities. The store app uses these capabilities to be able to download and update apps from the store so what APIs are used by this app? It uses (among others) the PackageManager class. This API is protected by the restricted capability packageManagement.

So the first experiment I tried was to build an update button in a test app and I tried to update myself. I created a version 1.0.0.0 (Project, Store, Create App Package and set the version to 1.0.0.0, I also created a version 2.0.0.0) In my code I added the following line in the click event:

Where the packageLocation pointed to a file on my disk (but could also be a URL to a website). But updating yourself didn’t work. So the next idea I had was to write a little app which I could call with app2app communication and the only thing that little app would do was update the calling app. This works perfectly. So I created a new project called AppUpdate (Blank App). I added another project to the solution called AppUpdaterService (Windows Runtime Component).  I defined 2 parameters (I only use 1 currently) to be passed to this background service and that’s the package family name and the package location.

The entire code of this class looks like this:

Make sure you add the reference to this project to your AppUpdater project.

Inside my dashboard app I call the following code to update myself through the updater app:

The cool thing that happens is my app is closed when the update starts and automatically restarted after the update. This works on both Desktop as Mobile. I still need to test this on my RPI3 and in combination with Assigned Access/Kiosk mode on mobile.

So what’s left? I need to implement something which checks for a new version regularly. I am still debating if I am going to use the updater app to get registrations from other apps and checks if there is an update and if it finds one starts updating the app, it is more generic this way. On the other hand, the app might know better when it should be updating or not and implement the logic itself and just uses the appupdater to do the update.

I was also thinking about using some kind of broadcast in the app to send an update command to the apps on all devices to be able to force an update after I published a newer version on my internal website.

How I need to check for a newer version could be as simple as providing a little text file on the webserver with the latest version number. If the app has a lower version it will update. Or perhaps I should test what happens if I call the update command and the version of the app on the server is the same. If the update is ignored i don’t need to write any specific code to handle this. It might not be the most optimal solution, although we only download the changes in packages.

How to use any app in assigned access mode in Windows 10

As I wrote before, by default when you setup assigned access the UI only shows app which have the aboveLockScreen extension registered. I talked to the PM who owns this feature to ask why and the reason is because we changed the behavior of how assigned access works (lock the screen and launch the app above the lock screen) we found out a lot of existing apps crash when running on the lock screen, so we changed the UI to only show apps which are designed to run above the lock screen.

Although the UI might not show your existing apps anymore you used to run as kiosk app, you can still use those. Obviously you need to test if they work when running above the lock screen.

Besides using MDM or a provisioning package to configure assigned access you can also use PowerShell to setup your app to run. You  can find the documentation over here.

You will also find interesting documentation how to setup auto login and how to make a classic windows app the default app on that page as well.

This experience is something MS wants to improve in the future but for now you have to use this trick to setup your old app as assigned access app.

How to debug DirextX on Windows 10 Mobile

Another one of these little ‘gotchas’. Morten asked the question why he couldn’t debug DirectX on mobile, but it was possible on desktop and the IOT version of windows 10. I am not a DirectX expert at all, but this was weird. So I asked around internally what was going on.

First, if you want to do this on Desktop you need to install the graphics tools as an additional feature before you can do this.

This is something you need to do for Mobile as well, although it happens a bit different. You can do that by hitting ALT-F5 in Visual Studio or use the menu:

image

btw, you can also use ALT-F5 on desktop and make Visual Studio install the graphic tools for you.

After that you will be able to debug. The following line will return true instead of false:

Why do I only see OneNote and Skype when setting up assigned access in Windows 10?

If you are trying to setup assigned access in Windows 10, you go to settings, accounts, Other Users and there is a link to ‘set up assigned access’. First you need to create a local account you can use for assigned access. You can do that at this ‘Other users’ dialog as well.

On the Assigned access page you can choose an account and the app you want to run in ‘Kiosk’ mode.

image

The thing is, it only shows 2 apps in my list, OneNote and Skype Video, where are the rest of my apps?

image

We changed this behavior in Windows 10, once I figured that out it’s easy to spot in the documentation as well. You can find the documentation how to build an app which works in assigned access mode here: https://msdn.microsoft.com/en-us/library/mt633799(v=vs.85).aspx

So what’s different in Windows 10 is, once you login with the assigned access account. It starts the app, locks the device and runs the app above lock.  The reason you only will see OneNote and Skype video is because the apps have the ‘abovelock’ extension defined. It’s mentioned in the Appendix

The following is a sample application manifest, you can see the windows.aboveLockScreen uap extension. You must use this extension in your Windows 10 Universal Windows Platform (UWP) app in order for it to display in the Assigned Access app list in Settings.

So once you add this to your app manifest:

It will show up in the list as well.

Screensaver for my app

One of the things my Home Automation app needs to do is run forever. But I don’t want the screen to burn in either. I can allow the phone to lock the screen but at that time my app isn’t running. I could run some background tasks but there is no way to wake up the app and dismiss the lock screen automatically. Therefore I want an app which runs all the time but has some kind of build in screensaver.

First of all I need the app to prevent the lockscreen appearing. I can of course also configure the phone never to show the lockscreen, but I can also solve this in code. It took me some searching and help at twitter (thanks Neil) to figure this out. The useridlemode from Windows Phone isn’t there anymore. You now need to use Windows.System.Display.DisplayRequest().

So when trying to figure out how to determine how long a user is inactive I could only found some win32 API’s. Unfortunately these don’t work on Windows 10 Mobile (the ones I need that is). So I decided I needed to add a timer on every page. Whenever a user does something on the screen I reset the timer. If the timer fires I navigate to the screensaver.xaml page (and do the screensaver magic) and when the users hits the screen the app will return back to the MainPage.xaml.

Since this needs to be done from every page I created a new baseclass every page (except the screensaver page) is going to inherit from. I created a class called DashboardPage.cs

The constructor creates a timer (in this sample set to 5 seconds). Whenever the timer fires I redirect to the Screensaver page. Whenever PointerMoved event is fired the timer is reset. I found out that with the PointerMoved it works on desktop and mobile. You might need to add more events to make it foolproof, but for my scenario on the phone it works.

The only thing you need to change is in your XAML and the code behind. Your page needs to inherit from DashboardPage instead of page like this:

And you need to modify your XAML a bit as well. It needs to look like this:

You can find the complete solution over here.

Of course after I build this Morten Nielsen posted on Twitter he already build a solution. I think his solution is much easier to use.

Create a new project and add a new usercontrol to your project called Screensaver.xaml

The codebehind looks like this:

To get this working you need to add a single line to App.xaml.cs. Add the line after the Windo.Current.Activate()

What happens in the Screensaver code behind is a timer is started. Whenever the timer ‘ticks’ the popup with the screensaver is shown. A tap on the screen removes it again. Every time something happens on the screen the timer is reset. This works really well and you don’t need to modify every single page. So I think I will end up using this solution instead.

You can find a complete working sample here.

List of tasks I need to figure out for my home automation project

As I described before I am working on a little project to use some Lumia 640s in the house to control the home automation. Besides figuring out how to configure and roll out the devices, and figuring out how exactly I am going to put them in the walls, I also have a laundry list of items I need to figure out for the app on the device. Instead of waiting before everything is done I thought it might be useful to take you along the ride. It might even result in some people mentioning to me some of the things I need to figure out are already out there.

So this is the current list of ‘issues’ or tasks I want to figure out before bringing everything together in an app.

  1. App needs to Run forever (embedded mode in mobile like on RPI2)
  2. Dim screen when not used for x minutes (Windows.System.Display.DisplayRequest() helps preventing the lock, need a screensaver to prevent burn in)
  3. Resume app or display screen when movement is detected by using the camera as sensor
  4. Hey Cortana/speech integration in app (dim the lights, goodnight, increase temperature etc)
  5. Walkyie-Talkie or intercom functionality between rooms and broadcast (alljoyn?)
  6. Other device discovery to connect to for the walkie-talkie functionality etc.
  7. App is a Bluetooth beacon in every room (http://www.shenchauhan.com/blog/2015/10/28/bluetooth-le-beacons-in-a-uwp)
  8. Self-updating via update app
  9. IP Camera integration so I can watch the cameras from every room
  10. Alljoyn temp control for my Nest and perhaps per room when I add that future system as well
  11. Goodnight command to smartthings so i can turn off all lights in the entire house
  12. Alljoyn light control
  13. Motion sensor in garage and at frontdoor switches on security view on phone
  14. Wakeup time
  15. Radio/music/speaker in room control