Mobile Development Microsoft Mobile Platforms With acknowledgement to Rob Miles Department of Computer Science Introduction A bit of history > Where the Pocket PC came from > Where the Smartphone came from > Pocket PC Phone Edition At bit of architecture > How the platforms run the programs > Why managed code is wonderful A bit of construction > The tools you will need Pocket PC Originally called the “wallet PC” Launched in 1996 with Version 1.0 of Windows CE Superseded in the following year with Version 2.0 Initially available in keyboard and keyboard-less versions Breakthrough Pocket PC: Compaq Ipaq This was the first device to deliver on performance, display and battery life > 120MHz processor > 32MB of RAM > Flash ROM > RS232 and IR ports > 240x320 TFT colour display State of the art Pocket PC by circa 2005 Dell Axim V50s > 624Mhz Processor > 64MB RAM > 480x640 colour display > WIFI and Bluetooth > 3D Graphics accelerator Windows Mobile 5 upgradeable £150 less than the original IPAQ! Smartphone In 2001 Microsoft announced that it would be launching a range of Smarpthones (codenamed "Stinger") The Smartphones would be "Windows based" The version of Windows in question was Windows CE 3.0 Launched in October 2002 with Orange SPV Breakthrough Smartphone: SPV E200 First to deliver on performance and battery life: > 32MB user memory > Built in Bluetooth support > Built in camera > Smartphone 2003 Operating System > .NET Compact Framework State of the art Smartphone 2005: SPV C500 Launched in August 2004 > 64MB of internal memory > Fast internal processor (200 MHz) > Small form factor > Runs Windows Mobile 2003 Second Edition Being replaced by the C550 which adds Media Player 10 for protected content Pocket PC Phone Edition Combines PDA with phone > Launched in July 2002 > 206-MHz Intel StrongArm processor > 32MB RAM > Based on Pocket PC 2002 Breakthrough Device: XDA II Launched in April 2004 > 400MHz Processor > 128MB RAM > Camera > Bluetooth > Windows Mobile 2003 State of the Phone Edition: XDA IIS Launched in April 2005 > Integrated Keyboard > Improved performance Later Devices: 3G First 3G Windows Mobile Device > Branded as Orange M5000 > VGA resolution display (640x480) > WIFI support > Two cameras > Windows Mobile 5.0 Want one? It never really „took off?” Other devices of note Gizmondo > Offers a Windows CE based gaming platform with GPS, GPRS and 3D Acceleration built in > Licensed developers only (sadly) Imate JAM > Very small Pocket PC phone edition > New form factor for Pocket PC The Future… The development of the devices over the last few years has been amazing The systems are going to get more powerful and more connected Location based behaviour is now very easy to implement in systems Architecture If you write programs for the mobile devices you should plan to work in the Compact Framework using “managed” code This makes your programs > Portable > Safe > Easy to write Managed and Native Code Managed .NET Compact Code User Framework Program Class Libraries Native (Unmanaged Code) User Program .NET Compact Framework Common Language Runtime Processor and Operating System Services Native (unmanaged) code Programs are compiled to machine code for the target processor Created in C++ or Visual Basic and compiled for the specific hardware in the device Has direct access to the processor instruction set Scary stuff for uber-geeks Managed Code Programs execute within a managed environment Microsoft Common Intermediate Language CIL (MSIL) is Just In Time compiled on the target device (No Code is not produced for a specific target hardware Code is validated before execution Helps programmers sleep at night Managed Code is Better (unless you know better...!) You should concentrate on managed code development > it is easier and faster to create > programs are inherently more reliable and easier to debug However, we need to be aware that there is a performance penalty for working this way > the first time a method is called the run time system must "Just In Time" compile the CIL code for that method into machine code > this can lead to delays when programs start up and, sometimes during execution when new classes are loaded Inside a Managed Code Program Because the executable is a .NET program you can use ILDASM and other tools to manipulate it You could even create CIL applications for mobile devices if you wish P/Invoke is your friend If you need to get “down and dirty” from managed code you can use Platform Invoke (P/Invoke) This provides marshalling of data to and from calls to native methods You will use this to access some parts of the operating system the Compact Framework cannot reach: > Device Data: Battery Life etc > Placing Calls and SMS messages So, Rules To Code By Use Managed Code wherever possible Good reasons to use Native Code: > You *really* want speed > You *really* want to drive the hardware directly > You are being paid *really* large sums of money to do it Compromise > If you need native code, put it in a native code library and then talk to it via the Platform Invoke (P/Invoke) mechanism Writing the Code You can use C# You can use Visual Studio A lot of the forms behaviours map directly across to the mobile platform You do not need a real device for development > Ultimately you must implement on a real device: You will need a carrier to enable you to place phone calls or send/receive SMS messages Visual Studio 2008 and 2005 Professional These are a significant advance over Visual Studio 2003 The Forms editor now functions with a more complete emulation of the mobile device display The emulation of the devices is now at processor level and the „metaphor‟ is very realistic Deploying the Program When the program is executed from within Visual Studio it is copied into a directory on the target device and executed from there It is possible to deploy the program just as an executable file by copying it into a directory on the Smartphone using the ActiveSync For professional deployment you must build an installer Debugging The debug tools are very powerful You can: > Pause an executing program > Add a breakpoint to an executing program without stopping it These facilities work on the target device too You must however have used Debug mode to build the application The Remote Display Power tool can be useful here Finding the Program The more recent mobile phones are shipped with file browser programs you can use to find and run the executable directly Pocket PC owners can use the built in file browser Developers Toolkits… To start to develop you need: Visual Studio 2005/2008 Professional Edition > Active Sync. 4.5 Powertoys > You may also want to get the Microsoft Power Toys > http://www.microsoft.com/windowsxp/dow nloads/powertoys/xppowertoys.mspx > Note: Only XP supported: Windows 7 ..Watch this space..! Also, NOT supported by Microsoft Call to Action The devices out there are getting really powerful and connected They are about as easy to write for as desktop machines This is a new and rapidly evolving area where the scope for innovation is huge So get out there and get started!
Pages to are hidden for
"Mobile Development Microsoft Mobile Platforms With"Please download to view full document