1 / 38

Windows Mobile Application Development with Microsoft Visual Studio 2008

Windows Mobile Application Development with Microsoft Visual Studio 2008. Maarten Struys Windows Mobile Evangelist Alten -PTS Session Code : MOB201-SUN. Agenda. Introduction Creating a Windows Mobile Application Testing Windows Mobile Applications Data on the Device

leatrix
Download Presentation

Windows Mobile Application Development with Microsoft Visual Studio 2008

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows Mobile Application Development with Microsoft Visual Studio 2008 Maarten Struys Windows Mobile Evangelist Alten-PTS Session Code: MOB201-SUN

  2. Agenda • Introduction • Creating a Windows Mobile Application • Testing Windows Mobile Applications • Data on the Device • Making use of Device Capabilities • Battery Friendly Development • Conclusion

  3. IntroductionDeveloping Windows Mobile Applications • Use the same development tools as desktop developers • There are a few challenges • Slower processors • Battery powered devices • User Interface restrictions • Device Security • Application installation and execution • Encryption of data, devices can ‘easily’ be lost

  4. IntroductionWindows Mobile • One brand name for a wide variety of devices • Windows Mobile 6 Standard (Smart Phone) • Windows Mobile 6 Professional (Pocket PC) • Software Development Tools • Visual Studio 2005 Professional or better • Support for Native and Managed applications • .NET CF 1.0 and .NET CF 2.0 support • Visual Studio 2008 Professional or better • .NET CF 3.5 and .NET CF 2.0 support

  5. IntroductionInstalling the Windows Mobile 6 SDKs • To develop applications for WM 6 devices you need to install the WM 6 SDK’s • Separate downloads for Standard and Professional • Integrate seamlessly in Visual Studio 2008 • You can also download Windows Mobile 6.1 emulator images to target newer Devices • To develop for Windows Mobile 6.5 also install the Windows Mobile 6.5 DTKs

  6. IntroductionUsing the Development Tools • Developer experience identical for Desktop and Windows Mobile applications • Fewer UI controls available • Fewer API’s available • Target the .NET Compact Framework • Highly compatible subset of the full .NET Framework • Target Platform differs from Development Platform

  7. Developing ApplicationsChallenges • Dealing with different devices, different screen sizes and different hardware • Creating effective user interfaces • Synchronizing data with desktops / servers • Network connections • Battery life

  8. Targeting Different DevicesDevice Emulator is your Friend • Why use the emulator to begin with? • Allows targeting a large range of devices without having access to physical devices • Allows testing cellular connections without needing a costly physical connection • Allows easy testing of different security scenarios

  9. demo Creating your first Windows Mobile AppHello World in C++, C# and Visual Basic.NET

  10. Testing your ApplicationUnit Testing for Devices • Unit Testing is a procedure used to validate that individual pieces of source code are working properly • A Unit is the smallest testable part of code • In C# and VB.NET methods inside classes • Calling methods with different parameters and examining return values • Unit Tests are typically written by the developer

  11. Testing your ApplicationCreating Unit Tests • Unit Tests can be generated automatically or created manually • The latter makes sense for Test Driven Development • They will exist in a separate test project • You can target both the .NET CF 2.0 and the .NET CF 3.5 • Need at least Visual Studio 2008 Professional

  12. Testing your ApplicationExecuting and Retrieving Results • Unit Tests are started on the development machine but will execute on the device • Test results are displayed inside Visual Studio • Tests can be executed from inside Visual Studio 2008 or from a Command Prompt making use of mstest.exe

  13. demo Creating and Running Device Unit Tests

  14. Storing Data on the DevicePlanning ahead is Important • No application exists without data • Consider your data needs during design • Using unstructured data? • Providing my own data store functionality? • Using a real database on the device? • How about synchronization to a back-end server?

  15. Storing Data on the DeviceTwo ‘popular’ approaches • Using XML files • True platform independence • Good support in managed code with DataSet.ReadXml and DataSet.WriteXml • Overhead because of XML • Using SQL Server 2005 CE • Great performance • Use existing SQL Server skills • Design the database on the desktop • Needs the .NET Compact Framework 2.0 • Does not run on every device

  16. Storing Data on the DeviceTyped DataSet • In memory representation of a database • Manipulate data as a small relational database • Save or load contents to XML • Save or load contents to SQL Server Mobile or from remote server • Receive populated datasets from Web Service • Pass datasets to Web Service

  17. Storing Data on the DeviceSqlCeResultSet • Provides direct connectivity to the SQL Server Mobile Edition database • Supports forward and backward scrolling • Supports updates • Supports databinding

  18. Storing Data on the DeviceSynchronization with Backend Servers • Microsoft SQL Server 2005 / 2008(Express Editions supported) • Visual Studio 2008 (SP1) • Microsoft SQL Server Compact 3.5 (SP1) • Microsoft Synchronization Services for ADO.NET 1.0

  19. demo Using SQL Server CE

  20. Device CapabilitiesUsing already installed functionality • Windows Mobile Devices come with a lot of software already pre-installed • Pocket Outlook • Office Mobile • Internet Explorer • Windows Media Player • The Windows Mobile 6 Managed SDK exposes some of this functionality to application developers

  21. Device CapabilitiesManaged APIs to access Pocket Outlook • Wraps POOM • Using and managing Personal Information Manager items inside your own application • Contacts, Appointments, and Tasks • E-mail, SMS and MMS • Consistent interface to access information

  22. Device CapabilitiesPocket Outlook Classes

  23. Device CapabilitiesThe Gateway to your Device • Look at Microsoft.WindowsMobile namespace • Collection of classes, enumerations, and delegates • Ships as part of the Windows Mobile 6.0 SDK • Provide functionality for managed developers • Application and platform level APIs • More control of the device in managed code • Supplement existing libraries • No part of the.NET Compact Framework

  24. Device CapabilitiesMaking Phone Calls • Two lines of code to make a phone call Phone phone = new Phone(); phone.Talk(“123-456-7890”);

  25. demo Making use of Device Capabilities

  26. Battery Friendly DevelopmentIntroduction • Windows Mobile devices are very powerful • However, they are useless with empty batteries • Decreasing the used power means increasing the battery life • Don’t do anything unless it is absolutely necessary!

  27. Battery Friendly DevelopmentBe a Good Citizen (1) • When interacting with the user, an application is free to consume as much as necessary • Reducing the “necessary” amount is what performance optimization is all about • In the background, it should consume very little memory, and ZERO battery power • If all applications behave correctly, user satisfaction increases for each application and for Windows Mobile as a whole

  28. Battery Friendly DevelopmentBe a Good Citizen (2) • Don’t use the processor • Disable radio’s when not needed • Absolutely don’t use the processor when the application is in the background • Don’t use polling at any time • Limit application functionality when the battery level is low • Don’t keep the backlight on

  29. Battery Friendly DevelopmentDevice Differences • Windows Mobile Standard • Device can either be on or off • When off nothing works • Windows Mobile Professional • Device can be in suspend mode (sleep) • Separate state between on and suspend, called unattended • When the device seems off it is probably asleep

  30. demo Be Friendly to the Device Battery

  31. Session Summary (1) • Developing applications for Windows Mobile Devices is as easy as developing desktop applications • However …. • You have to deal with different form factors • You should develop battery friendly applications • Install the Windows Mobile 6 SDK’s • Make use of Unit Testing and the emulator to test your apps

  32. Session Summary (2) • SQL Server CE is a great database to store data locally and to synchronize with servers • Re-use existing functionality on the device • Access device hardware through the managed API’s that are part of the Windows Mobile SDKs • Take a look at the sample code in the SDKs to get started yourself

  33. question & answer

  34. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Resources • www.microsoft.com/teched Sessions On-Demand & Community • www.microsoft.com/learning • Microsoft Certification & Training Resources • http://microsoft.com/technet • Resources for IT Professionals • http://microsoft.com/msdn Resources for Developers

  35. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Related Content MOB01-IS - Windows Mobile Tips and Tricks for Developers MOB03-IS - Performance Optimization and Power Management for Windows Mobile Devices MOB05-IS - Come Meet the Windows Mobile Team! MOB307 Introducing the patterns & practices Mobile Application Blocks

  36. Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!

  37. Required Slide © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related