iasi 15 noiembrie 2009 introduction to windows mobile programming
TRANSCRIPT
Introduction toWindows Mobile
programming
Catalin GheorghiuSolution Architect
I Computer Solutions
AgendaWindows Mobile Platform Overview
Quick Recap on Visual Studio 2005 and what new in Visual 2008
Why Windows Mobile?
Some issues facing the mobile developer
UI and user input challenges
Q&A
New Product Families
Pocket PCSmartphonePocket PC Phone Edition
Windows Mobile 6 .1 Classic Windows Mobile 6 .1 Standard Windows Mobile 6 .1 Professional
Microsoft Windows Mobile 5.0 Microsoft Windows Mobile 6.1
http://www.microsoft.com/windowsmobile/en-us/meet/version-compare.mspx
Windows Mobile Standard(aka – Smartphone)
Non-touch platform designed for one handed use (I do not agree with this)
New Naming Conventions
Windows Mobile Professional(aka – Pocket PC)
Touch screen - enabled for flexible input
Both are great options for Mobile Messaging
Modularity and FlexibilityNew Product Family
Standard Pro Classic
Platform
Basic platform and applications, including:Microsoft Office Outlook MobileInternet Explorer MobileMedia Player MobileActiveSync
Touch screen UI
Windows Mobile Update
Windows Mobile Marketplace
IP Telephony
Applications
Office Mobile
Window Live Mobile
Voice Command 1.6
Remote Desktop Mobile
Windows Mobile Device Choice
Windows Mobile 6 DevicesBased on Windows Embedded CE and supports the .NET Compact FrameworkWindows Mobile 6 devices include more software in ROM
.NET Compact Framework 2.0 SP1SQL Server 2005 Compact Edition 3.1AJAX application capabilities
Top 10 Enterprise Features of Windows Mobile 6.1
1. Mobile Messaging enhancements2. Office Mobile3. Enhanced security capabilities4. Increased calendaring capabilities5. Internet Explorer browser enhancements6. Windows Mobile update7. Remote Desktop mobile8. Microsoft Windows Mobile Device Center 20089. Mobile document access10.Internet connection sharing
Top 6 Features of Windows Mobile 6.5
1. Windows Mobile Widgets2. New Today Screen/ Start Menu /Lock Screen3. Enhanced ergonomics (contacts/messaging/mail)
Build with finger operation in mind.4. Pocket Internet Explorer 6 browser 5. MyPhone Sync service6. Windows Marketplace for Mobile
Tools for Device Developers
Embedded Visual Tools 3.0
Microsoft eMbedded Visual C++ 4.0
Visual Studio .NET 2003
Visual Studio 2005
Visual Studio 2008
eVBWindowsCE30
eVC 3.0
Managed and Native!Desktop Parity, Designers,
DataDevice Emulator 1.0 and 2.0*.NET CF Framework 1.0 and
2.0Microsoft Windows CE 5.0
and 6.0Smartphone and Pocket PC 2003, Windows Mobile 5.0*
Windows Mobile 6*
Native and ManagedDevice Emulator 3.0
Security Aware IDE / Unit TestingWindows CE 5.0 and CE 6.0
Windows Mobile 2003 Smartphone** and Pocket PC (**Native Only)
Windows Mobile: • 5.0 Smartphone and Pocket PC• 6 Professional* and Standard*
• 6.1 Professional*And Standard*• 6.5 Professional*And Standard*
.NET Compact Framework 2.0 and 3.5
Managed OnlyWindows CE
4.2.NET Compact Framework 1.0
Smartphone and Pocket PC
2003
Native OnlyWindows CE 4.0 5.0Smartphone and PPC
2003X86 Emulator
*Do Not Ship in the box, Install independently
Parity with desktop development experiencesWYSWYG designers with skins supportWindows Mobile 2003 SDKs in the BoxNative code development
Migration from eMbedded Visual C++MFC 8.0 / ATL / Win32
.NET Compact Framework 1.0 and 2.0Microsoft SQL Server 2005 Mobile Edition
Data designer supportSetup project (CAB)Microsoft Device Emulator 1.0
VS 2005 Device Development Features
Added 15 MFC classesDevice Emulator 2.0 (Standalone Release)Numerous bug fixes
Better eMbedded Visual C++ 4.0 Migration Support
Ability to work with SQL Server 2005 Compact EditionUpdated the Native Compilers and Remote ToolsAbility to support Windows CE 6.0-based SDKsSupport for Windows Mobile 6 SDKs
Visual Studio 2005 SP1
Version 2.0 now available Updated for Windows Embedded CE 6.0 and
Windows Mobile 6 releaseShips with the SDK or download standaloneIn-place update of previous version
EnhancementsAverage 40% gain in performanceSupport for Windows VistaNumerous bug fixesBattery emulationNotification LED in skin
Device Emulator 2.0
Visual Studio 2008 Enhancements
Unit Testing for Devices
Device Configuration Manager
Device Certificate Manager
Device Emulator Version 3.0
Windows Mobile 5.0 SDK is in-the-box
.NET Compact Framework 2.0 SP1 and 3.5
Updated Native Compilers and MFC Libraries
Managed CoreCon Framework
Windows Communication Foundation support (over email)Support for LINQ (XML, Objects and Dataset)New Tool - CLR ProfilerCompression SupportClient side certificatesSound APIs Windows Forms enhancementsManaged debugger fixes
.NET Compact Framework 3.5 Addressing key developer issues
.NET Compact Framework~30% of the surface area in ~10% of the size
CopyGround-up rewrite Snapshot & Modify
System.Windows.Forms
System.Net
System.IO
System.Resources
System.Threading
System.Xml
System.Data
System.Messaging
System.Text.RegularExpressions
Microsoft.VisualBasic
System.ServiceModel
System.Collections
System.Collections.
Generic
System.Cryptography
System.IO.Ports
System.String
System.Text
System.Globalization
Microsoft.Win32.Registry
System.Web.Services
System.Drawing
Microsoft.DirectX.Direct3DMobile
Execution Engine,JIT, GC, Loader, Assembly Cache
Microsoft.ServiceModel.
Channels.MailTransport
~90% scope of
.NET Framework
Unit testing support for managed device applicationsSame experience as unit testing for desktop applicationsIntegrates seamlessly with Team System and Team Foundation ServerLets you easily test your application across various device configurationsSupport for Test Execution from Command Line
Unit Testing for Devices
Device security configurationUnderstand and manage device security settingsExport security settingCreate custom security setting
Manage certificates on the deviceView certificates on the deviceAdd or remove certificates to/from the device
Security Aware IDE
Build on top of existing core connectivity frameworkInternally used by our own tools (e.g., unit testing)Makes it easy to build your own remote toolsAdd reference to:
Microsoft.Smartdevice.Connectivity.dll
Managed Core Connectivity Framework
EnhancementsAutomation support Access to interfaces via Visual Basic ScriptMade it easy to add custom images in the Device Emulator ManagerXML config file to configure emulator instances
Device Emulator 3.0
Windows Mobile SDK ComponentsDocumentationSample CodeEmulator images & skin filesNative development itemsTools
Lend Me Your Ear…
Private / Public APIs
Lifecycle &
Ecosystem
Persistent
Storage
Virtual Memory
InstallDisplayPowerCode
Signing
Perf!Security Policies
Platform updates driven by mobile ecosystemUpdates are aligned with OEM Support is a partnership between Microsoft, OEM, and Mobile Operator
Lifecycle and Ecosystem
Mobile Operator
OEM/ODM
Microsoft
Mobile UI Challenges
ScreenSize, orientation, resolution, layout
InputSIP, keyboard, dedicated buttons, stylus
User InteractionStanding up on a moving bus
Understand System.Windows.FormsCompactnessForm and Control classes
Windows Mobile 2003 SE changed everythingo VGA, Square Screen, Landscape…CE Subsystem 4.21 and higher are aware; 4.20 and lower use emulation layer.
HI_RES_AWARE resource can overrideEmulation is practical—not beautiful
Display Assumptions - history
Apps that “assume” anything about the screen size of a device will have problems
Are you ready for high-res, square screen, and landscape?
Video frame buffers may be non-linear (direct access)Emulation may mask some issues
Display Assumptions
Don’t assume anythingTest on different devices/emulatorsUpgrading to .NET Compact Framework 2.0 in Visual Studio 2005 makes you aware by default:
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
Take advantage or docking and anchoring and state info (DisplayRotation) for simple needs
Display Assumptions - tips
Screen LayoutDo not try to create non-full screen formsTop stripMain AreaBottom strip
Screen to Form
Top stripDon’t hide the title barUse the same title in owned forms
Bottom stripDon’t use a toolbar controlDon’t use more than two menusDon’t hide the bottom strip
Main AreaPlace tappable controls near the bottomTextBoxes or anything requiring the SIP, near the top
Form Basics
StartupHiding vs. ClosingForm NavigationApplication Termination
By UserBy platform (!)
• Application.Run• MinimizeBox• Show vs. ShowDialog• Remote Process Viewer• Running Programs List• MobileDevice.Hibernate
Screen-Aware
SizeOrientationResolutionUI design per form factor
What platform am I on?
Patterns & PractisesMobile Client Software Factory (http://www.codeplex.com/smartclient)
Orientation-Aware control
Demo – Form Basics
Lifecycle of a form (& app) plus navigation
Handling InputKeyboardSIP
Respond to Show/Hide
Dedicated ButtonsStylus or Finger
TapTap and Hold
Typically for context menusDon’t use this!
• InputPanel• HardwareButton• Tap events• Click, MouseDown,
MouseMove, MouseUp
Single-Handed Operation
Design your app so it can be keyboard driven
Soft keys, D-PadAutomatically, you are in a good place for Smartphone
Besides previous advice......make it finger driven
Learn from Smartphone ModelEntirely Keyboard driven
D-Pad (Left, Right, Up, Down, Enter)Good use of Soft Keys are crucial
Controls are stackedLabel, LinkLabel, CheckBox, ComboBox, TextBox, DateTimePickerTabIndex, TabStop
...or full screenListView, TreeView, DataGrid
Q & A
Blog URL:http://itboard.ro/CS/blogs/catalins_blog/default.aspx
Contact Provide Feedback!
Get the free app for your phone athttp://gettag.mobi
SNAP
IT