Project

General

Profile

Bug #1365

Enhanced User Agent

Added by cpg about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/09/2014
Due date:
% Done:

0%


Description

At this time we see the following: AmahiAnywhere/1.0.0 (Android 4.4.2)

I think we discussed this without a clear conclusion.

We would really like to know more, eg. phone vs. tablet. Not sure if resolution is the closest thing we can add there. But we should explore this, or just not know much about our user's devices, which is not good.

History

#1 Updated by cpg about 8 years ago

  • Status changed from New to Assigned
  • Assignee set to cpg

This page http://stackoverflow.com/questions/10085361/set-default-user-agent-in-android

has details on how to get the default user agent:

String ua = webview.getSettings().getUserAgentString();

Even though we are not using webview, is it too much overhead to do stuff, is actually instantiating a webview for this OK, in general?
it would be once only at app initialization time and perhaps the webview could be freed, once we have a copy of the string.

#2 Updated by ming about 8 years ago

According to the documentation web UA will look like this.

Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36

As you see there are no screen identifiers or any other useful information.

Let’s discuss what specifically you wish to see. I see phone or tablet identifier. Anything else?

#3 Updated by cpg about 8 years ago

We need the following:
  • version of android (we have that now)
  • phone vs tablet. apparently the webview UA will contain the word "Mobile" if it's a phone. no idea about phablets
  • ideally, the device name (nexus one, nexus 5, nexus 7, nexus 10, ..)
  • ideally the resolution of the device

#4 Updated by ming about 8 years ago

Not sure how resolution can help—both phone and tablet can have FullHD resolution and experience would be totally different.

Is this UA fine?

AmahiAnywhere/1.0.0 (Android 4.4.2; Nexus 4) Device/Phone Display/1280x768
AmahiAnywhere/1.0.0 (Android 4.4.2; Nexus 7) Device/Tablet Display/1920x1200

#5 Updated by ming about 8 years ago

For the record—the Android developer console provides such stats as application version, Android version, devices, countries and languages.

#6 Updated by cpg about 8 years ago

Basically, this is very little information (and used seldom)and it's not private. What you propose is a great UA.

It will help, over time, to understand the usage and interfaces of our users.

One thing, tho ... "Device/Phone" (or tablet) seems interpreted from somewhere. If that somewhere provides that bit of info only (i.e. it's known to be tablet or phone), then that's fine. If not, then we rather have access to the raw uninterpreted information (so that later can be processed).

Example: maybe the setting only indicates "Mobile" vs. not. In that case we want that information, not that interpreted by our code and passed as phone/tablet. It could well be that that setting reflects whether there is a phone/mobile data in the device, but it still may be a tablet. We need the raw info, uninterpreted by code, to make the best possible use of it without losing information.

#7 Updated by ming about 8 years ago

There is no such strict thing as a tablet or a phone on Android. The documentation and a possible solution.

The following UA will be better teller about screens. The smallest width will be helpful, but it is really Android-specific and is helpful mostly for development.

AmahiAnywhere/1.0.0 (Android 4.4.2; Nexus 4) Size/4.7 Resolution/1280x768
AmahiAnywhere/1.0.0 (Android 4.4.2; Nexus 7) Size/7.02 Resolution/1920x1200 

#8 Updated by cpg about 8 years ago

I understand that there is a hard to distinguish boundary these days ... hence my concern at "Device/Phone" being interpreted somehow. That is why I think whatever information is in the OS is better to pass along.

The latest thing you proposed with Size is a great piece of information.

I assume you know how to get at all that info to make up our UA :)

#9 Updated by ming about 8 years ago

  • Status changed from Assigned to Closed

Also available in: Atom