Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing Native Code for Pocket PC 2003 Marcus Perryman

Similar presentations


Presentation on theme: "Developing Native Code for Pocket PC 2003 Marcus Perryman"— Presentation transcript:

1 Developing Native Code for Pocket PC 2003 Marcus Perryman marcpe@microsoft.com

2 Agenda Introduction to Native Code Introduction to Native Code Embedded Visual C++ Embedded Visual C++  What you need  Language capabilities  Debugging and Tools Pocket PC 2003 Lab Pocket PC 2003 Lab Windows Mobile 2003 2 nd Edition Windows Mobile 2003 2 nd Edition  Screen Rotation  HiDPI

3 Introduction to Native Code Development

4 Windows Mobile Roadmap Richer Platform Capabilities.NET CF “Whidbey” MFC 8.0, ATL 8.0 Broad managed code support Notification broker, Location, Camera, SQL CE, D3DM.NET CF SP2 VGA (PPC) Square (PPC) Landscape (PPC) QVGA (SP).NET CF Enhanced Emulator Configuration Mgr, Bluetooth, SMS MFC 3.0, ATL 3.0 Active Sync Connection Mgr MAPI OBEX Telephony MFC 3.0 Win32, POOM MFC 3.0 Win32, POOM Better Development Visual Studio 2005 formerly VS “Whidbey” (C#, VB.NET, C++) eVC 3 (C++) eVC 4 (C++) VS.NET 2003 (C#, VB.NET) eVC 3 (C++) eVC 4 (C++) VS.NET 2003 (C#, VB.NET) eVC 3 (C++) eVB 3 (VB) Core OS WinCE “Macallan” WinCE 4.2 WinCE 3.0 WinCE 3.0 WinCE 3.0 More Device Choices Future Windows Mobile 2003 Second Edition 200320022000

5 Why Use Native Code Managed Code limitations (CF 1.0) Managed Code limitations (CF 1.0)  System Extensions  No CLR hosting  Home screen add-in’s, Drivers, other dll’s  COM interop  Wrapper classes  Complex interfaces i.e. MSMQ, Registry  Performance  GAPI, complex math, specialized optimization Migration / legacy / porting Migration / legacy / porting

6 Tool History Pocket PC April 00 Oct 01 H1 2002 Pocket PC 2002 2003 Win CE 3.0 Win CE.NET (4.0) 4.2 4.1 SP 1 Jan 02 June 00 Embedded Visual Tools 3.0 Embedded Visual Tools 4.0

7 PPC 2002 SP 2002 Pocket PC 2003 Smartphone 2003 WinCE OS 3.03.04.24.2 eVC3.03.0 4.0 (SP2) eVB3.0--- VS.NET 2003-20032003.NET CF 1.0-1.0 1.0 SP1 MFCX-X- ATLX-XX eVB (runtime) X- X (RAM) - SQL CE X-X- ADO.NET X-XX MSMQX-XX Web Server X-X- Tools Matrix

8 Development Choices APIStrengths Microsoft Win32 (C / C++)  Smallest and fastest.exe files and DLLs.  Lowest memory overhead.  Required for device drivers, control panel applets, shell extensions  No runtime required; Windows CE.NET is the runtime. MFC / ATL (C++)  Object-oriented. Inheritance, Encapsulation, Polymorphism  Classes support arrays, lists, and simplify data handling.  Type safety  Complete MFC/ATL source code ships with tools.  Good tool support & wizards.NET Framework (C# and Microsoft Visual Basic®.NET)  Well-designed programming interface.  Object-oriented. Inheritance, Encapsulation, Polymorphism  Classes support arrays, lists, hashtables, dictionaries, and stacks.  Type safety  Namespaces.  Automatic garbage collection eliminates memory leaks.  MSIL / CIL, provides binary portable of executable (.exe &.dll)  Web service clients are quick and easy to write.  Great support for handling XML.  Great tool support — Forms Designer

9 Developing with Embedded Visual C++ 4.0

10 What do you need? EVC 4.0 with Service Pack 2 or 3 EVC 4.0 with Service Pack 2 or 3  Side by side with v3.0, VS.NET 2003 Requires SDK’s for Device Dev Requires SDK’s for Device Dev  Windows Mobile 2003 SDK provides headers, lib’s, help etc. Active Synch 3.6 for Device Debugging Active Synch 3.6 for Device Debugging  Not required, but very useful  Prefer using Ethernet connection. Free tools Free tools  EVC 4.0 and SDK’s (including Emulator)

11 Integrated Development Environment Very similar Visual Studio 6.0 Very similar Visual Studio 6.0  eVC 3.0 and 4.0 very similar Improvements Improvements  Syntax colouring  Intelisense improvements  Improved reliability Device specifics tightly integrated Device specifics tightly integrated  Processor choice  Integrated download and debugging Integrated Help System Integrated Help System  Provides platform specific info

12 Creating “Hello World”

13 Language Options C / C++, MFC and ATL available C / C++, MFC and ATL available  MFC subset  ATL great for COM object C++ Exceptions (from v4.0) C++ Exceptions (from v4.0) try { …} catch () {…} throw() Runtime Type Information (from v4.0) Runtime Type Information (from v4.0)dynamic_cast<>()typeid()type_info Standard Template Libraries (from v4.0) Standard Template Libraries (from v4.0)

14 MFC Enhancements All Windows/Dialogs are Full-Screen All Windows/Dialogs are Full-Screen All UI Elements are Drawn Flat (no 3D) All UI Elements are Drawn Flat (no 3D) Window Borders Have Been Removed Window Borders Have Been Removed Single Application Instance Support Single Application Instance Support Transparent Support for New Menu Bar Transparent Support for New Menu Bar Support for Pocket PC Document List Support for Pocket PC Document List Tap and Hold Context Menu Support Tap and Hold Context Menu Support No MDI support No MDI support  Document + View available

15 Debugging Capabilities Process Attach Process Attach  DLL and COM object debugging  Complex repro scenarios JIT Debugging JIT Debugging  Debug handler on device  Option to link to debugger on desktop Multithreaded debug Multithreaded debug  All threads stop with breakpoint  More accurate debugging multi thread application.

16 Remote Tools  Error Lookup  Retrieve Error Strings  File Viewer  Transfer files to/ from device  Heap Walker  View memory allocations  Process Viewer  View processes + threads  Registry Editor  Manage remote registry  Spy ++  Track window messages  Zoomin  Screen snapshot

17 Remote Tools (cont)  Call Profiler  /callcap  /Gh for X86  Kernel Tracker  Performance Monitor  System Information

18 Pocket PC 2003 Hand on Lab

19 Lab overview Lab Part 1 Lab Part 1  Explore the remote configuration features of Pocket PC 2003, using XML to programmatically modify the device configuration. Lab Part 2 Lab Part 2  Language improvements and project migration from eVC 3.0 to eVC 4.0 sp2. Lab Part 3 Lab Part 3  New remote tools and debugging experience Build a Scribble application About 1 hour to finish About 1 hour to finish

20 Windows Mobile 2003 2 nd Edition

21 Windows Mobile Roadmap Richer Platform Capabilities.NET CF “Whidbey” MFC 8.0, ATL 8.0 Broad managed code support Notification broker, Location, Camera, SQL CE, D3DM.NET CF SP2 VGA (PPC) Square (PPC) Landscape (PPC) QVGA (SP).NET CF Enhanced Emulator Configuration Mgr, Bluetooth, SMS MFC 3.0, ATL 3.0 Active Sync Connection Mgr MAPI OBEX Telephony MFC 3.0 Win32, POOM MFC 3.0 Win32, POOM Better Development Visual Studio 2005 formerly VS “Whidbey” (C#, VB.NET, C++) eVC 3 (C++) eVC 4 (C++) VS.NET 2003 (C#, VB.NET) eVC 3 (C++) eVC 4 (C++) VS.NET 2003 (C#, VB.NET) eVC 3 (C++) eVB 3 (VB) Core OS WinCE “Macallan” WinCE 4.2 WinCE 3.0 WinCE 3.0 WinCE 3.0 More Device Choices Future Windows Mobile 2003 Second Edition 200320022000

22 Goals for 2 nd Edition Enable Device Diversity Enable Device Diversity  Drive innovation for new device ‘ID’s’  Drive software innovation  Improved user experience Minimize developer impact Minimize developer impact  Common look and feel  Automate and emulate for ‘legacy’ apps

23 2 nd Edition Features New Screen Aspect Ratio’s (Pocket PC Only) New Screen Aspect Ratio’s (Pocket PC Only)  Dynamic Operating System rotation support  Square, landscape and portrait screen support HiDPI screens HiDPI screens  NOTE: this is a DPI change, NOT a screen size change!  Same physical size  Designed to enable high quality screens ExistingNew Pocket PC 240 x 320 96 dots per inch 480 x 640 192 DPI Smartphone 172 x 240 96 DPI 240 x 320 131 DPI

24 Screen Rotation demo

25 Types Of Orientations & Screens Portrait240x320Landscape320x240 Square 240x240

26 Support for Existing Apps Full screen applications resized Full screen applications resized  Screen layout may need work Auto scroll bar for dialog boxes Auto scroll bar for dialog boxes Menu’s auto scroll Menu’s auto scroll Warning dialog on install: Warning dialog on install:

27 Orientation Aware Use ChangeDisplaySettingsEx() Use ChangeDisplaySettingsEx()  Respond to WM_SIZE  Respond to WM_SETTINGCHANGE  wParam = SETTINGCHANGE_RESET  Can be used to block rotation Application should re-layout Application should re-layout  Fit to window  Consider replacement controls Design dialogs for Square Design dialogs for Square Off-screen controls!! Off-screen controls!!

28 HiDPI screens

29 Goals Keep one app for both DPI settings Keep one app for both DPI settings Support existing applications Support existing applications  Provide DPI “emulation” for existing apps  Best effort experience  Pocket PC only Allow new applications to be DPI aware Allow new applications to be DPI aware  Use hires graphics  Better customer experience

30 What Is DPI Awareness? More detail per element More detail per element NOT tiny text NOT tiny text

31 Emulation Layer Default to emulation layer Default to emulation layer  Pocket PC only  App believes it is running on 96 DPI  Layer stretches app to screen pixels Main Difference: Main Difference:  Text looks sharper/better 96 DPI 192 DPI

32 HiDPI Aware Apps Disable Emulation Disable Emulation  Gives access to real DPI  Requires scaling of screen coordinates Provide HiDPI images Provide HiDPI images  Use resource DLL’s to maintain one app Windows Mobile 2003 2 nd Edition resource download Windows Mobile 2003 2 nd Edition resource download  Samples, help etc…

33 SQL Server CE 2.0

34 SQL Server CE Overview Key Scenarios Key Scenarios  Disconnected database  Internet / Intranet connectivity / synchronization  Different from Mobile Web Forms / MMIT, ADO.NET Data Set and MSMQ CE  Managed and Unmanaged Support Customer Scenarios Customer Scenarios  Medical, Military, DSD, FSA, SFA, Real estate

35 Database Feature Set Rich functionality for small footprint Multi-column indexes Multi-column indexes Referential integrity Referential integrity Sub-selects (IN) Sub-selects (IN) Defaults Defaults Inner/outer joins Inner/outer joins One file database One file database Null support Null support Unicode support Unicode support Transactions Transactions Data-types Data-types  Real, Numeric, NVarChar, NText, Image, Integer, DateTime, VarBinary, UniqueIdentifier, Money Having/group by Having/group by Seek on index Seek on index Set functions Set functions Identity attribute Identity attribute Local security - DB encryption (128bit) and database password Local security - DB encryption (128bit) and database password

36 OLEDB CE CLR /.NET CF QP/Cursor Engine/ES CE Data Access Storage Architecture Client Agent: Replication andRDA ADO CE v3.1 OLEDB / Replication API IIS CLIENTSERVER Storage Engine / Repl Tracking SQL CE Edition v2.0 eVB 3.0 eVC 3.0 OLEDB OLEDB Server Agent: Replication and Remote Data Access HTTP XML/BizTalk/CS 2002 802.11b, CDPD, GSM, CDMA, TDMA, etc. Enterprise Backend Oracle / db2 / etc SQL Server CE Data Provider Native/Unmanaged Stack Data Provider SQL Server Client Data Provider ADO.NET VS.NET (VB.NET, C#).NET CF / Managed Stack TDS Ethernet Well Connected Occasionally Connected

37 Summary Embedded Visual C++ 4.0 (sp2) is the tool of choice for building native code for Pocket PC Ozone. Embedded Visual C++ 4.0 (sp2) is the tool of choice for building native code for Pocket PC Ozone. Windows Mobile 2003 2 nd Edition adds device diversity – design for square and consider HiDPI benefits for your app. Windows Mobile 2003 2 nd Edition adds device diversity – design for square and consider HiDPI benefits for your app. SQL CE provides a rich and powerful database solution both connected and disconnected for mobile devices. SQL CE provides a rich and powerful database solution both connected and disconnected for mobile devices.

38 © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "Developing Native Code for Pocket PC 2003 Marcus Perryman"

Similar presentations


Ads by Google