mngsk / device-detector

The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable Capture platform deatils using User Agent in Spring Boot for in Some Mobile Device

unaveen opened this issue · comments

I'm facing an issue with capturing device details for Xiaomi phones using the user agent.

using the following user agent:
Mozilla/5.0 (Linux; Android 12; 2109119DI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36

I have followed the following link: https://github.com/mngsk/device-detector

My code is like:

   `` DeviceDetector dd = new DeviceDetectorBuilder().build();
    Detection detection = dd.detect(userAgent);
    System.out.println(detection.getDevice());``

in this I'm getting null value for the device, the model,brand

{ "model": null, "type": "smartphone", "brand": null }

Expected Output is:
{ id: "XI", type: "smartphone", brand: "Xiaomi", model: "Mi 11 Lite 5G NE" }

please help me to solve this issue

using Java Version: JDK11