- Newest
- Most votes
- Most comments
Unfortunately, there isn't a direct way to determine the exact local device type that a logged-in user is using with Elastic Instances in AWS AppStream 2.0. AppStream 2.0 is designed to provide a consistent streaming experience across different devices, which means it abstracts away many of the specifics of the local device.
The approach you're currently using - detecting screen resolution - is actually one of the better methods available for approximating the device type. However, as you've noted, this method is not foolproof and can vary depending on device models and user settings.
Here are a few additional suggestions that might help:
-
User Agent String: If your application includes a web component, you might be able to access the user agent string. This can provide information about the browser and operating system, which can give clues about the device type.
-
Feature Detection: Instead of trying to determine the exact device type, you might consider using feature detection to optimize your display. This involves checking for specific capabilities (like touch support, screen size ranges, etc.) rather than trying to identify the exact device.
-
User Preferences: You could consider allowing users to select their device type or preferred display settings manually. This could be stored as part of their user profile.
-
Responsive Design: Implement a responsive design that adapts to different screen sizes and resolutions. This approach can work well across a wide range of devices without needing to know the exact device type.
-
AppStream 2.0 API: While it doesn't provide direct device information, you might be able to use the AppStream 2.0 API to get some session information that could be helpful.
Remember that due to the nature of streaming applications, the ability to detect local device characteristics is limited. Your current approach of using screen resolution as a hint, combined with some of these other techniques, is likely the best way to approximate device types and optimize your display accordingly.
Sources
Use DescribeInstanceTypes with an AWS SDK or CLI - Amazon Elastic Compute Cloud
DeviceInstance - AWS Device Farm Documentation
DeviceType - Amazon Cognito User Pools
answered 2 years ago
Hi, Didier_Durand. Thanks for responding. My users will be using a browser such as Safari or Chrome on an iPhone/iPad/Android phone/Android tablet, but the app I'm providing to them on AppStream 2.0 is a traditional Windows desktop app (with a GUI, using Win32 functionality) so there's no web component on the AppStream side. But since they're using a browser on the client side, is there a way I can get the agent string from their browser from within my app? I have the ability to execute things in a command prompt and can also execute PowerShell commands. Or, is there a way to make the browser send my app the agent string? Or, could I somehow "attach" a device identifier to the login URL they use? For example, the URL they will be using is this (with the ?ref= obfuscated):
https://appstream2.us-east-1.aws.amazon.com/userpools#/signin?ref=**********
Could I do something like this:
https://appstream2.us-east-1.aws.amazon.com/userpools#/signin?ref=**********&device=iPhone
And then somehow access that info within my app?
Thanks!
answered 2 years ago

Hi, I'd agree with the bot on 1. : the agent String from the browser (if you've web components) is probably the simplest way to know about the client OS.