How to identify whether a device is Surface Hub in code?

325 Views Asked by At

Recently we have started expanding our App to support Surface Hub(both 55-inch & 84-inch). At many places we designed entirely different set of UIs for Hub thus the need come up to identify the device is Surface Hub or not so that we could show the specific UI.

I explored various Device identification/Input Apis but unfortunately none of them provides any lead on identifying a device.

I don't remember it fully but I guess I read it somewhere that now UWP SDK doesn't allow developers to identify specific device types since UWP app is expected to run on all kinds of Win 10 running devices - may be someone could confirm this. However since the Resolution of Hubs are much higher than normal Desktop/Tablet devices I'm sure showing various UIs can be manipulated using VisualState triggers.

Still it'd be great if somehow I would be able to identify whether a device is Surface Hub or not before my App starts running, more like identifying whether touch capabilities are present on the current device.

Hopefully someone would be able to help me out with a reasonable solution here!

2

There are 2 best solutions below

1
BoltClock On

This article suggests multiple times that Surface Hub has its own device family, but this article says that only apps targeting the Universal device family will run on Surface Hub, and makes no mention of a Surface Hub device family or some sort of digital whiteboard device family that the device will advertise itself as being a part of.

However, there's a class called Windows.System.Profile.Shared​Mode​Settings that contains an IsEnabled property that only returns true either on a PC with a certain policy enabled, or a Surface Hub. Using that in combination with VisualState triggers, and perhaps even Windows.Devices.Input.TouchCapabilities.TouchPresent, is probably the closest you'll get to determining if the device is a Surface Hub using feature detection.

3
Mamoru Satoh On
if(AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Team")
{
    // surface hub
}

There are some way to have the tailored UI for each device families. Yes, one is device trigger. Or, you can have the totally separate view (XAML) for Surface hub.

For example, you can select the main view at app.xaml.cs:

rootFrame = new Frame();
if(AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Team")
{
    // surface hub
    rootFrame.Navigate(typeof(MainPageForSurfaceHub), e.Arguments)
}
else
{
    rootFrame.Navigate(typeof(MainPage), e.Arguments)
}

Following presentation will help you.

Surface Hub: Building Windows Universal Apps for Surface Hub and the Large Screen