0

When users land on my page, I would like to present them with a text saying

"You are using {device name}."

So for someone on a Samsung Galaxy 7 it would be:

"You are using the Samsung Galaxy 7."

What is the best way to go about this to display this in my page please?

Thanks

pheroMona13
  • 462
  • 8
  • 17
mat boy
  • 109

4 Answers4

0

In order to get android device name you have to add only a single line of code:

android.os.Build.MODEL;

Found here: getting-android-device-name

Kani Raj
  • 106
  • 1
  • 6
0

If you are looking for a javascript solution, use wurfl.js https://web.wurfl.io/#wurfl-js

Include the js file and access the returned object to check if it's a phone.

From my phone, it's as follows.

{
    "is_mobile": true,
    "complete_device_name": Motorola MotoG3,
    "form_factor": Smartphone
}
Aneeez
  • 1,422
  • 3
  • 15
  • 20
0

Here is another solution in Js, No registration is needed.

And I don't think you will be able to get the device details, unless you are going native. You will only be able to detect, if the browser is mobile and which type of browser it is.

Hope this helps.

Community
  • 1
  • 1
Nakul
  • 1,313
  • 19
  • 26
0

Now I've tried this: https://frubil.info/

console.log(FRUBIL.device.marketname); // Galaxy S7
pepin
  • 1