If you are using Microsoft Internet Information Services 4.0 or later, a file named BROWSCAP.INI exists in the directory \WINNT\system32\inetsrv. This file contains descriptions of all known browsers at the time of service pack installation.

Here is the description of the Internet Explorer for Pocket PC needed for the BROWSCAP.INI:

 ; Pocket PC  [Mozilla/2.0 (compatible; MSInternet Explorer 3.02; Windows CE; 240x320)]  browser=Pocket Internet Explorer  version=4.0  majorver=#4  minorver=#0  platform=Windows CE  width=240  height=320  cookies=TRUE  frames=TRUE  backgroundsounds=TRUE  javaapplets=FALSE  javascript=TRUE  vbscript=FALSE  tables=TRUE  activexcontrols=TRUE 

Be sure to check this information on a regular basis, as it may change.

Other web servers, such as Apache, support similar configuration files. Consult the web master or system administrator for more information.

Internet Explorer for Pocket PC is actually a mixture of Internet Explorer 3.02 (HTML), Internet Explorer 4.0 (Scripting), and Internet Explorer 5.0 (XML) components. That is why it is identified as Microsoft Internet Explorer 3.02 although it uses version 4.0 inside the properties.

When Internet Explorer for Pocket PC 2002 sends a request to an HTTP server, the following user agent information is sent to the server:

 HTTP_USER_AGENT - Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)  HTTP_UA_OS - Windows CE (POCKET PC) - Version 3.0  HTTP_UA_LANGUAGE - JavaScript  HTTP_UA_PIXELS - 240x320  HTTP_UA_VOICE - FALSE  HTTP_UA_COLOR - color16  HTTP_UA_CPU - ARM SA1110 

If your existing web application requires the browser of the viewing device to be IE 5.0 and above, you can change the registry to reflect a later version of Internet Explorer. See "Changing Registry Settings on the Pocket PC" in the "Advanced Topics" section of this chapter. That said, you shouldn't rely on the user agent solely to detect devices.

Using Middleware to Detect the Pocket PC

Developers can create special optimized pages with Flash content for the Pocket PC as soon as an Internet Explorer for Pocket PC enters the site by using any middleware language, such as ColdFusion, ASP, JSP, or PHP.

The following example is an ASP script that sends the Pocket PC user to a new page.

 <%  '     This specifically tests for Pocket IE on Pocket PC 2002 by searching for the "PPC"  graphics/ccc.gifstring within  '     the User Agent field. "PPC" is only included in the USER AGENT header field on  graphics/ccc.gifPocket PC 2002.        userAgent = Request.ServerVariables("HTTP_USER_AGENT")        isPocketPc = false        '     This checks to see if the browser is any version of MSIE on Windows CE. That  graphics/ccc.gifway, if the browser        '     gets updated, this should still detect that it is from a Windows CE machine.        if(userAgent <> "" AND (InStr(userAgent, "PPC") > 0)) then            isPocketPc = true        end if        if isPocketPc then            '     If the user is connecting with a pocket pc, then we redirect them to  graphics/ccc.gifanother page.            response.redirect("sucess.html")        else            response.write("You do not have a Pocket PC")        end if  %> 

You can also use middleware for loading in data to the Flash application on the Pocket PC. See the "Using Data with Flash for the Pocket PC" section in this chapter, as well as Chapter 10, which addresses dynamic data.

Using JScript to Detect the Pocket PC

The following is useful for desktop systems for pushing proper content to them while still providing the right content for the Pocket PC. To identify the Pocket Internet Explorer using client-side scripting (JScript), use the following:

 var strNav = navigator.userAgent;  // Check for Windows CE (Pocket PC, Palm-size PC, Handheld PC, Handheld PC Pro)     var isCE = strNav.indexOf("Windows CE");     if(isCE > -1) {  //add Windows CE specific code     }     else {  //add code for other platforms     }  // Check for Pocket PC     var isPPC = strNav.indexOf("240x320");  if(isPPC > -1) {  // add Pocket PC specific code     }     else {  // add code for other platforms     } 

Place your specific code there in the commented areas "//".

Macromedia Flash Enabled. Flash Design and Development for Devices
Macromedia Flash Enabled. Flash Design and Development for Devices
ISBN: 735711771
Year: 2002
Pages: 178 © 2008-2017.
If you may any questions please contact us: