×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    16

    a question about the user agent string

    Hi

    I just stepped into the J2ME community, and I have a general question regarding the user agent string.
    How do you get the device model from the user agent string? Do you have a parser to parse the user agent string or there is persistent storage to store the mapping between the device and all its user agent strings.
    The disadvantage of the second way is that you have to enumerate all possible user agent strings for a specific device, and that is a time consuming process. So I think the first one may be better. But I have no idea where to start. Because the I did not fully understand the format of the user agent string, and it seems there is no standards for the user agent string, because these user agent strings look so different.
    Thanks for help!!

  2. #2
    Registered User
    Join Date
    Oct 2003
    Location
    london, uk
    Posts
    31

    Arrow Re: a question about the user agent string

    Although i haven't parsed user agent strings in Java i have an active list so you can see what you have to play with.

    go here: http://www.infinitelives.tv/MMD/installs.php - it's a big page.

    Generally the user agent string has key/value pairs. There can be any number of these, each pair separated by a space and each keyword and value seperated by a "/". The first key/value pair is normally the handset model and model version. There are exceptions: the firmware if present will be in brackets () and the firmware normally appears after the model/model version pair.

    Structure:

    <model>/<modelVersion> (<firmware>) <some stuff> Profile/<midpVersion> Configuration/<cldcVersion> <some more stuff>

    Examples:

    MOT-C650/0B.D1.09R MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0 UP.Link/6.3.0.0.0
    Nokia6230/2.0 (05.35) Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.0.0.0
    SIE-CX65/18 Profile/MIDP-2.0 Configuration/CLDC-1.1
    SonyEricssonK700i/R2AY SEMC-Browser/4.0.3 Profile/MIDP-2.0 Configuration/CLDC-1.1

    Nokia series 60 devices and similar have this format, the important additions being the Symbian version and series 60 level:

    Nokia3650/1.0 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0
    Nokia6620/2.0 (4.22.1) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0
    Nokia6630/1.0 (3.45.113) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1
    Nokia7650/1.0 SymbianOS/6.1 Series60/0.9 Profile/MIDP-1.0 Configuration/CLDC-1.0
    NokiaN-Gage/1.0 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0
    NokiaN-GageQD/1.0 (0) SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0
    SIE-SX1/1.1 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0

    There are some that break the rules. Vodafone sometimes mucks about with the string:

    Vodafone/SonyEricssonV800/R1S025 Browser/SEMC-Browser/4.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
    Vodafone/Sharp902SH/SHG001/1.0 Browser/UP.Browser/7.0.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1

    So, what you need to extract from the user agent could be done by looking for "profile/" and "configuration/" to determine capability. The phone model is all text up to the first "/", and the handset version is the text between the first "/" and the first space. The firmware should always be the string in the first pair of () brackets if present. For completemess if the user agent string begins "Vodafone/" take that off before working on the string.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    16

    Re: a question about the user agent string

    Thanks robinellis70 for the helpful post! It is great to have so many user agent strings list on the page. But it seems there are some duplicated user agent strings.
    I may have a question on the part "UP.Link/6.3.0.0.0". What does that stand for? Is it a browser? I also know some user agent strings will begin with some stuff like "mozilla compatible"
    Thanks again for your explanation!

  4. #4
    Registered User
    Join Date
    Oct 2003
    Location
    london, uk
    Posts
    31

    Arrow Re: a question about the user agent string

    Sorry: i should have said that the list of user agents is actually our full install log so there are lots of repeated entries. At least you can see the range.

    Regarding UP.Link, it is something i ignore but more information is here: http://www.thewirelessfaq.com/4.8.asp

Similar Threads

  1. Geting user agent
    By fjorge_ht in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2005-05-17, 14:28
  2. Replies: 2
    Last Post: 2004-09-15, 22:47
  3. User Agent Profile Question
    By octopuscn in forum General Development Questions
    Replies: 1
    Last Post: 2003-11-13, 03:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×