Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samsung Galaxy S6 SM-G920T identified as tablet #73

Open
emmettbutler opened this issue Feb 1, 2017 · 3 comments
Open

Samsung Galaxy S6 SM-G920T identified as tablet #73

emmettbutler opened this issue Feb 1, 2017 · 3 comments

Comments

@emmettbutler
Copy link
Contributor

emmettbutler commented Feb 1, 2017

In [1]: import user_agents
In [2]: agent = "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G920T Build/MMB29K)"
In [3]: parsed = user_agents.parse(agent)
In [4]: parsed.os
Out[4]: OperatingSystem(family='Android', version=(6, 0, 1), version_string='6.0.1')
In [5]: parsed.device
Out[5]: Device(family='Samsung SM-G920T', brand='Samsung', model='SM-G920T')
In [6]: parsed.browser
Out[6]: Browser(family='Android', version=(6, 0, 1), version_string='6.0.1')
In [7]: parsed.is_tablet
Out[7]: True
In [8]: parsed.is_mobile
Out[8]: False

The S6 should be identified as mobile instead of tablet. From my read of the code, it looks like _is_android_tablet could use some updates.

I discovered this while investigating this issue on Parse.ly's open source Android SDK.

@drlatech
Copy link

drlatech commented Feb 10, 2017

There are also 2 more models which are shown as tablets.

  1. Samsung-SGH-I527, with this user agent
    Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; SAMSUNG-SGH-I527 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30 FB_IAB/FB4A;FBAV/104.0.0.17.71;

  2. Samsung-SPH-L600
    Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; SPH-L600 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30 FB_IAB/FB4A;FBAV/85.0.0.15.70;

I debugged function parse in parsers, the problem is that there is no 'Mobile' in user agent, before Safari, so this automatically becomes tablet. I thought that this could be related with screen size and resolution. They are 6.3 inches.

@emmettbutler
Copy link
Contributor Author

emmettbutler commented Jun 12, 2017

Another user agent shown as a tablet that should parse as mobile:

Dalvik/2.1.0 (Linux; U; Android 7.1.2; Nexus 6P Build/N2G47O)

@UdayVarkhedkar
Copy link

Attached is a txt file of multiple mobile user agents that are incorrectly being parsed as tablets.
Misclassified_Mobile_UserAgents.txt

emmettbutler added a commit to emmettbutler/python-user-agents that referenced this issue Jun 21, 2017
these device family names were found by running the parser against a Parse.ly internal dataset of user agents the parser had incorrectly identified as mobile.

fixes selwin#73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants