Author Topic: User-Agent doesn't tell device model  (Read 2032 times)

Offline SunboX

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
  • Karma: 0
    • View Profile
    • Bessa App
User-Agent doesn't tell device model
« on: November 20, 2013, 08:19:01 AM »
Hi,

could you plz add the model to the navigator.userAgent so we as developer could decide to turn features on or off?

Geeksphone Keon userAgent:
---------------------------------
Mozilla/5.0 (Mobile; rv:18.1) Gecko/18.1 Firefox/18.1

RAM: 512 MB

ALCATEL One Touch Fire userAgent:
---------------------------------
Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1

RAM: 256 MB

There's actual no way to check how much RAM a device has, only way is to decide by userAgent. :/

Offline c.martinez.lozano

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 661
  • Karma: 97
    • View Profile
Re: User-Agent doesn't tell device model
« Reply #1 on: November 21, 2013, 01:45:12 AM »
Can't you access to /proc/meminfo?

This file from kernel, have all detailed memory info on all devices.

Regards.

Offline luis.cuervo

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 64
  • Posts: 816
  • Karma: 114
    • View Profile
Re: User-Agent doesn't tell device model
« Reply #2 on: November 21, 2013, 01:56:02 AM »
Yes, you should get RAM info from this file. It has the correct permissions and access using the API FileReader.

Offline SunboX

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
  • Karma: 0
    • View Profile
    • Bessa App
Re: User-Agent doesn't tell device model
« Reply #3 on: November 21, 2013, 05:11:47 AM »
Oh, didn't know this! Thanks, sounds great! I will take a look :)

Offline SunboX

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
  • Karma: 0
    • View Profile
    • Bessa App
Re: User-Agent doesn't tell device model
« Reply #4 on: November 21, 2013, 09:34:24 AM »
I can't get it working. :/ See my detailed comments at stackoverflow:

http://stackoverflow.com/questions/20103893/zte-open-useragent-string/20122171#20122171

greetings,
SunboX

Offline luis.cuervo

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 64
  • Posts: 816
  • Karma: 114
    • View Profile
Re: User-Agent doesn't tell device model
« Reply #5 on: November 22, 2013, 12:19:49 AM »
Sorry, but we cant help you with this. Like someone comments in stackoverflow sniffing UA strings is not a good solution because it can be easily changed. By far the best solution is to try to get this info from the device trying to read meminfo, but without any logs we cannot see why it's not working for you and we dont know so well HTML5 to help you.

In Stackoverflow that is a more developer forum you will get more hints that here.