Windows Phone Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...




Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Developer

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2002, 09:17 AM
Andy Sjostrom
Pontificator
Join Date: Aug 2006
Posts: 1,177
Default User Agent strings

Web masters that are looking for ways to transform web pages based on what browser requests the pages will find these little strings useful:

Pocket PC 2002
Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)

Smartphone 2002
Mozilla/2.0 (compatible;MSIE 3.02;Windows CE; Smartphone; 176x220)

These are the User Agent strings that the Pocket PC 2002 and Smartphone 2002 sends to the web server when requesting a page. By intercepting the User Agent string, content can be programmatically transformed or the browser can just be redirected to another page.

The following couple lines of ASP code illustrate one way of reading the User Agent string to set boolean values, that later on can be used to decide what content to send from the web server. (This code executes on businessanyplace.net. Developer: Chris Forsberg)

Public IsPPC, IsMME, IsThinClient
IsPPC = (InStr(Request.ServerVariables("HTTP_USER_AGENT"), "Windows CE") > 0)
IsMME = (InStr(Request.ServerVariables("HTTP_USER_AGENT"), "MME") > 0)
IsThinClient = (IsPPC Or IsMME)

Of course... the Microsoft Mobile Internet Toolkit and the Mobile Controls do this elegantly from out of the box...!
 
Reply With Quote
  #2  
Old 02-28-2002, 11:45 AM
Ian Chia
Pupil
Join Date: Feb 2002
Posts: 10
Default User Agent strings

Quote:
Originally Posted by Andy Sjostrom
Pocket PC 2002
Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)

Smartphone 2002
Mozilla/2.0 (compatible;MSIE 3.02;Windows CE; Smartphone; 176x220)
Hi Andy,

Actually since a number of end users manually tweak Pocket IE's useragent variables in order to get through sites that lock out IE3, wouldn't it be better to detect for the HTTP_UA_OS variable?

PIE on a Pocket PC reports:

HTTP_UA_OS - Windows CE (POCKET PC) - Version 3.0
HTTP_UA_PIXELS - 240x320
HTTP_UA_VOICE - FALSE

I don't have access yet to a Smartphone, but I imagine the HTTP_UA_OS would stay the same, but the HTTP_UA_PIXELS and HTTP_UA_VOICE variables would change accordingly, giving developers a more bulletproof way to detect for Pocket PC and SmartPhone devices.

Just a thought.

Regards,

- Ian
 
Reply With Quote
  #3  
Old 02-28-2002, 11:59 AM
innersky
Ponderer
Join Date: Feb 2002
Posts: 95

I knew I was right about the Smartphone screen resolution
 
Reply With Quote
  #4  
Old 02-28-2002, 12:49 PM
Andy Sjostrom
Pontificator
Join Date: Aug 2006
Posts: 1,177

I often choose not to use the UA variables, since IE is the only browser that uses them, AFAIK.., but since this is a situation where IE is the only browser that I want to detect... so, here we go:

Pocket PC 2002:
HTTP_UA_OS - Windows CE (POCKET PC) - Version 3.0
HTTP_UA_PIXELS - 240x320
HTTP_UA_VOICE - FALSE

Smartphone 2002:
HTTP_UA_OS - Windows CE (smartfon) - Version 3.0
HTTP_UA_PIXELS - 176x220
HTTP_UA_VOICE - TRUE

"smartfon"!? A typo w a European twist? (Phone in Swedish is "telefon")
 
Reply With Quote
  #5  
Old 02-28-2002, 01:54 PM
Ian Chia
Pupil
Join Date: Feb 2002
Posts: 10

Quote:
Originally Posted by Andy Sjostrom
HTTP_UA_OS - Windows CE (smartfon) - Version 3.0
Andy,

Thanks for the above. Did you get the "smartfon" from an emulator in the SDK or is it actually from a real device? Seems a little strange that it's lower case compared to "Pocket PC" and in a different language.

I haven't got my SDK yet, so a little in the dark here.

Does the SDK doco say anything about the UA_OS variable?

Many thanks,

- Ian
 
Reply With Quote
  #6  
Old 02-28-2002, 02:42 PM
Andy Sjostrom
Pontificator
Join Date: Aug 2006
Posts: 1,177

The strings are retrieved from the emulator in the SDK.
The SDK says many things about most things, but not too much specifically regarding the UA_OS.

-Andy.
 
Reply With Quote
  #7  
Old 02-28-2002, 02:51 PM
Ian Chia
Pupil
Join Date: Feb 2002
Posts: 10

And a final question, if you're feeling generous Andy. Thanks for taking the time to reply so far.

Does the SmartPhone still render ActiveX controls within Pocket IE, just like the Pocket PC? eg. For example, does the MonthCal ActiveX from the PPC2002 SDK sample work within the SmartPhone SDK?

Many thanks,

- Ian
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:22 PM.