How to detect Mobile devices like Pocket PC?? RRS feed

  • Question

  • User1989204087 posted
    Hi all,
    Need help on this. As you know there is PDA-phone like Pocket PC-phone run on Window Mobile 2003 and above. It has Ms Internet Explorer of scale down version.

    So, the question is this kind of device is under mobile device category but having IE browser. So, how to detect this kind of MObile device using MobileCapabilities class?  YOu see, SmartPhone also have Ms IE browser. How to tell them apart?? If I serve Pda-html website to SmartPhone, its screen size will be too small for it.

    My objective is this : to detect the PDA device and Mobile Phone .

    If it is PocketPC-phone, I will serve PDA-html website or Mobile web base on customer selection.
    If it is smartphone or WAP 2.0 -base mobile phone, I will serve  Mobile Web.

    please help.
    Tuesday, June 7, 2005 4:11 AM

All replies

  • User1625204979 posted
    What about checking the capability "browser" = "Pocket IE" from the MobileCapabilities?
    Thursday, June 16, 2005 5:23 PM
  • User286710293 posted
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not IsPostBack Then
                Dim Browser_obj As System.Web.Mobile.MobileCapabilities = CType(Request.Browser, System.Web.Mobile.MobileCapabilities)
                If Browser_obj.Browser = "Pocket IE" Then
                    Label1.Text = "the is Pocket PC"
                ElseIf Browser_obj.Browser = "IE" Then
                    Label1.Text = "Microsoft Internet Explorer"
                ElseIf Browser_obj.Browser = "Phone.com" Then
                    Label1.Text = "the is Openwave"
                End If
            End If
        End Sub


    Pocket PC 2002   Pocket IE
    Openwave 7.0   Phone.com
    Internet Explorer   IE
    Thursday, June 16, 2005 8:33 PM
  • User1989204087 posted
    Hi TrueLove,

    I forgot to ask you this question:

    1. Smart phone and PDA-phone both share the same PocketPC internet explorer.

    So, base on your code, you can not tell which one is smart phone and which one is PDA-phone!!  My objective is that if I detect a PDA-phone, then I will direct the user to Mobile Page which has bigger Page for bigger screen size.

    Can you help on this??
    Wednesday, June 22, 2005 8:44 AM
  • User1625204979 posted
    Will the capabilities screenPixelsHeight and screenPixelsWidth help in this case?
    Wednesday, June 22, 2005 6:10 PM
  • User286710293 posted
     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not IsPostBack Then
                Dim browser As System.Web.Mobile.MobileCapabilities = CType(Request.Browser, System.Web.Mobile.MobileCapabilities)
                If browser.ScreenCharactersWidth < 20 Then
                    Label1.Text = "short text message"
                    Label1.Text = "long text message"
                End If
            End If
        End Sub

    My English is very poor ,Maybe I can't express my meaning exactly.

    Notice:20 is Characters Width in line
    Openwave 7.0 only has 19 Characters
    you can test browser.screencharacterswidth value for you Smart phone and  you PDA-phone
    Wednesday, June 22, 2005 8:52 PM
  • User786498364 posted
    better is :

    if browser.IsMobileDevice = true then ....

    w/Regards from Poland
    Pawel Janowski

    Friday, September 9, 2005 5:41 AM
  • User1822830079 posted
    Hi ALL

    I Believe what you need is in this site



    Greetings from PORTUGAL
    Tuesday, November 8, 2005 11:29 PM
  • User336673788 posted

    truelove, "what a hmm name" LOL

    thanks for the information that you posted above. your chinglish is very good. =)



    Monday, November 12, 2007 7:22 PM
  • User1088344998 posted

    Nope. That just handles desktop browsers. The answer is above.

    Monday, January 14, 2008 11:37 PM
  • User-654561728 posted

    or if you want to know more than just browser type, try using www.handsetdetection.com - it detects the mobile browser, then returns live results on screen size and device capabilities

    Thursday, July 10, 2008 2:07 AM
  • Tuesday, September 30, 2008 10:47 AM
  • User977690511 posted

    How does Request.Browser["IsMobileDevice"] do its work?  The only information that the server has still has to come from the HTTP headers and they are retrieveable from Request.ServerVariables["ALL_RAW"].  How does it catch up with new browsers that come up after the .NET Framework has been released?

    I scanned through all the browsers that hit my web server, and it looks like all mobile browsers except one has a non-null x-wap-profile in Request.ServerVariables.  Testing for the presence of this would give a good indication that it is a phone browser.  The one exception is the iPhone.  It does not have this field.  The word "iPhone" is in the user agent field.  But it is still hardcoding.


    Wednesday, October 1, 2008 11:54 AM
  • User-412700345 posted

    look at this asp code for mobile detection and redirections


    Monday, November 3, 2008 5:26 AM
  • User1634317999 posted


    for my experience the best strategy to detect mobile devices and mobile browsers is to use the HttpBrowserCapabilities and extend the pre-defined capabilities of the .NET Framework with the actual devices and browsers. I use user agent strings and header information to determine which phone is requesting the page.

    Monday, November 3, 2008 8:38 AM
  • User1135281112 posted

    You can easily detect a mobile device using http://www.51degrees.mobi/Products/NETMobileAPI

    This API gives detailed information of the device making the request and also has the facility to redirect user automatically to mobile specific page when request in coming from mobile device.

    I have found this very useful and easy to implement in mobile website developments.

    Let me know if you face any issues in usage.


    Friday, July 31, 2009 6:54 AM
  • User981004358 posted

    The latest capabilities list which is available in WURFL can be read using 51degrees.mobi Foundation API which detects all mobile devices. It is a .NET open source available in Codeplex http://51degrees.codeplex.com/releases.

    It easily detects if the request is coming from any mobile device and redirects user to mobile landing page. It has few user friendly samples to try out.




    Monday, August 9, 2010 1:24 AM
  • User981004358 posted


    The latest releases are here http://51degrees.codeplex.com/releases.


    - Thanks

    Friday, August 13, 2010 9:38 AM