Android Tablet Identified As Desktop
Posted: April 13th, 2022, 7:55 pm
I am trying to add device specific logic using the GetContext service, and it's working for both Chrome on my desktop and the Android app on my phone, but the Android app via my tablet is coming back as "Desktop". Is there a reliable way to know if a mobile device or the app is being used?
When I use the GetHttpData service, I see the different user agents and, seemingly in situations where the Android app is used, "x-requested-with" with a value of "com.krisesystems.easyprocess". Would any of this be consistent enough to parse and reliably determine if the user is using a mobile device/app or not?
Android Phone App
Windows Desktop Browser
Android Tablet App
Android Tablet Browser
Android Tablet Browser (Desktop Mode)
When I use the GetHttpData service, I see the different user agents and, seemingly in situations where the Android app is used, "x-requested-with" with a value of "com.krisesystems.easyprocess". Would any of this be consistent enough to parse and reliably determine if the user is using a mobile device/app or not?
Android Phone App
Code: Select all
Mozilla/5.0 (Linux; Android 10; SM-N960U1 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36
Windows Desktop Browser
Code: Select all
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36
Android Tablet App
Code: Select all
Mozilla/5.0 (Linux; Android 12; SM-T970 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Safari/537.36
Android Tablet Browser
Code: Select all
Mozilla/5.0 (Linux; Android 12; SM-T970) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36
Android Tablet Browser (Desktop Mode)
Code: Select all
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36