iasi 15 noiembrie 2009 introduction to windows mobile programming

39
Introduction to Windows Mobile programming Catalin Gheorghiu Solution Architect I Computer Solutions

Upload: catalin-gheorghiu

Post on 09-May-2015

81 views

Category:

Mobile


1 download

TRANSCRIPT

Page 1: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Introduction toWindows Mobile

programming

Catalin GheorghiuSolution Architect

I Computer Solutions

Page 2: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 3: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 4: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 5: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 6: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Windows Mobile Device Choice

Page 7: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 8: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 9: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 10: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 11: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 12: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 13: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 14: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 15: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 16: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

.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

Page 17: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 18: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 19: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 20: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 21: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Windows Mobile SDK ComponentsDocumentationSample CodeEmulator images & skin filesNative development itemsTools

Page 22: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Lend Me Your Ear…

Private / Public APIs

Lifecycle &

Ecosystem

Persistent

Storage

Virtual Memory

InstallDisplayPowerCode

Signing

Perf!Security Policies

Page 23: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 24: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 25: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 26: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 27: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 28: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Screen LayoutDo not try to create non-full screen formsTop stripMain AreaBottom strip

Page 29: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming
Page 30: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 31: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Form Basics

StartupHiding vs. ClosingForm NavigationApplication Termination

By UserBy platform (!)

• Application.Run• MinimizeBox• Show vs. ShowDialog• Remote Process Viewer• Running Programs List• MobileDevice.Hibernate

Page 32: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 33: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming
Page 34: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Demo – Form Basics

Lifecycle of a form (& app) plus navigation

Page 35: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 36: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 37: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

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

Page 38: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Q & A

Page 39: Iasi  15 noiembrie 2009   Introduction to Windows Mobile programming

Blog URL:http://itboard.ro/CS/blogs/catalins_blog/default.aspx

[email protected]

Contact Provide Feedback!

Get the free app for your phone athttp://gettag.mobi

SNAP

IT