Click here to Skip to main content
15,881,689 members
Articles / Programming Languages / Visual Basic

Pocket PC Simulated Resizable Browser

Rate me:
Please Sign up or sign in to vote.
4.10/5 (4 votes)
18 Jan 2008CPOL3 min read 42.7K   860   23   9
A mini browser for PDA web developers.

Pocket PC Browser

Introduction

Developing a web page for PDAs often requires special consideration on user experience because the PDA screen is substantially smaller than those in other development environments. Developers usually re-size the desktop browser to approximately the size of the PDA browser for debugging and testing. While this is OK, the developer experience and user experience are not the same. This Pocket PC Simulated Browser intends to close the gap between developer experience and user experience. It is not an emulator. It is just a browser allowing developers to have a better experience of their final product.

New Feature in Version 3

In the first two versions, you cannot alter the size of this browser. However, in real life, not all PDA and PDA phones have the same browser size. So, I included a resizable browser in this version.

Using the Code

This is a Windows Forms project. I mostly rely on Visual Studio 2005's built-in WebBrowser control for development. All of the code is quite straight-forward and are self-explanatory. Please feel free to download the source code to find out more about the programming logic.

I also included an installer. You can install the browser to your PC without understanding the internal mechanism. The pre-requisite is to have .NET Framework 2.0 installed on your Operating System. After installing the program, you can use it as a mini browser.

However, the purpose of this project is to facilitate developers to use it during development. We, therefore, need to link it up to Visual Studio 2005.

Linking the Brower to Visual Studio

After installing this browser, you can open a web application in Visual Studio 2005. On the Solution Explorer, right-click the web page that you want to use this browser with and select "Browse With..". You can see the following dialog box for adding any browser:

Image 2

Points of Interest

Unlike C#, VB.NET starts a Windows Application from Windows Forms directly. While this is very convenient, it cannot provide the opportunity for you to pass in external parameters or arguments. In this project, I need to link it to Visual Studio 2005. Visual Studio 2005 will pass the web page of the development server to the browser for debugging. So, I need to tweak the start-up of this project with the following code:

VB
Module Module1

    Friend strHomeUrl As String = ""
    Sub Main()
      Dim arrArgs() As String = Command.Split(",")

      If arrArgs(0) <> Nothing Then
        strHomeUrl = arrArgs(0)
      End If

      Application.Run(New Form1)

    End Sub

End Module

As soon as Form1 is loaded, it can call strHomeUrl in its load event. However, the string passed from Visual Studio 2005 is bracketed by a pair of quotation marks. These quotation marks must be removed by the program so that strHomeUrl can become a valid URL.

History

  • Project was posted at CodeProject in May 2007.
  • Project updated in June 2007 with better Favorite support.
  • Project updated in September 2007, added a resizable feature.
  • Source code of version 3 added upon readers' request.
  • In December 2007, added a web-based version. It can be found in http://www.codeproject.com/KB/webforms/pbc1.aspx.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Bisware Technology Limited
Hong Kong Hong Kong
I am an IT consultant and software developer based in Hong Kong.

Please click here to see my blog and my company at biswaretech.com

Comments and Discussions

 
GeneralVersion 3 Source Code Pin
knarfm15-Jan-08 3:41
knarfm15-Jan-08 3:41 
GeneralRe: Version 3 Source Code Pin
petersgyoung15-Jan-08 15:28
petersgyoung15-Jan-08 15:28 
GeneralRe: Version 3 Source Code Pin
knarfm26-Jan-08 6:11
knarfm26-Jan-08 6:11 
General"External" arguments in VB Pin
Rei Miyasaka16-Sep-07 11:56
Rei Miyasaka16-Sep-07 11:56 
GeneralRe: "External" arguments in VB Pin
petersgyoung17-Sep-07 15:16
petersgyoung17-Sep-07 15:16 
GeneralBe aware, the Pocket IE is not only limitted in size compared to Desktop IE Pin
hjgode7-Jun-07 23:57
hjgode7-Jun-07 23:57 
GeneralRe: Be aware, the Pocket IE is not only limitted in size compared to Desktop IE Pin
petersgyoung8-Jun-07 18:45
petersgyoung8-Jun-07 18:45 
AnswerRe: Be aware, the Pocket IE is not only limitted in size compared to Desktop IE Pin
commandant_.16-Jun-07 23:08
commandant_.16-Jun-07 23:08 
GeneralRe: Be aware, the Pocket IE is not only limitted in size compared to Desktop IE Pin
leechangjun29-Mar-11 21:55
leechangjun29-Mar-11 21:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.