Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing Managed Code for Smartphone 2003

Similar presentations


Presentation on theme: "Developing Managed Code for Smartphone 2003"— Presentation transcript:

1 Developing Managed Code for Smartphone 2003
Tony Whitter

2 Smartphone 2003 Based on Windows CE .NET 4.2
.NET Compact Framework in ROM Same classes as Pocket PC ADO.NET Web services Rich Forms Designer XML Support Platform Invoke to CE APIs

3 Smartphone NETCF Controls
Supported Excluded Label TextBox MainMenu CheckBox PictureBox Panel ComboBox ListView TreeView HScrollBar VScrollBar Timer ProgressBar ImageList Button RadioButton ListBox TabControl DomainUpDown NumericUpDown TrackBar ContextMenu ToolBar StatusBar OpenFileDialog SaveFileDialog InputPanel Unsupported DataGrid

4 Missing Controls Multi-Item Picker Date and Time Pickers

5 Smartphone User Interface
Follow guidelines within the SDK Left menu item can only be default action No pop up menu items (Unsupported Exception) Right menu item can be pop up Entry fields should be identified by a Label above the field

6 Input Modes Pocket PC provides Soft Input Panel for data input
Smartphone uses Input Modes

7 Input Modes Need to use Native Interop Input Mode Description
EIM_SPELL Also known as multitap EIM_AMBIG T9 predictive text input EIM_NUMBERS Numeric only EIM_TEXT Either Spell or T9, depending on which of these was last used by the user in an edit control with the EIM_TEXT input mode. Use this in edit controls where the user's mode preference is to be used as the default mode. SendMessage(hControl, EM_SETINPUTMODE, 0, EIM_NUMBERS); Need to use Native Interop

8 Native Interop Platform Invoke (P/Invoke) Caveats
Call custom native code and Windows APIs Declare statement in Visual Basic .NET DLLImport Attribute in C# / Visual Basic .NET Very flexible Good support on the device Caveats No COM Interop Marshalling is limited

9 MessageBox int MessageBox( HWND hWnd, LPCTSTR lpText,
LPCTSTR lpCaption, UINT uType ); [DllImport("coredll.dll")] private static extern int MessageBox( IntPtr hWnd, string lpText, string lpCaption, uint uType); Private Declare Function MessageBox Lib "coredll.dll" ( _ ByVal hwndOwner As IntPtr, _ ByVal lpText As String, _ ByVal lpCaption As String, _ ByVal uType As Integer) As Integer

10 MessageBox using System.Runtime.InteropServices;
[DllImport("coredll.dll")] private static extern int MessageBox( IntPtr hWnd, string lpText, string lpCaption, uint uType); MessageBox(IntPtr.Zero, "Hello World!", "Interop1", 0); Loads and initialises coredll.dll Locates the entry point MessageBox Calls into the unmanaged code Completes and returns back to managed code

11 Interop Warnings Some data types require manual marshalling
Nested reference types Unsafe code in C# Wrapper DLL in C++ Handling of HWNDs is unsupported Forwards compatibility is not guaranteed

12 Scrolling Forms Used for larger amounts of data entry
Automatic for native applications Create dialog to be longer than screen Ensure vertical scrollbar is enabled No automatic support in managed code Implement using a Panel and VScrollBar

13 Scrolling Downwards Scrolling down should fit the next control on the bottom of the form

14 Scrolling Upwards Scrolling upwards should fit the previous control at the top of the form If the control has a label identifier, this should be at the top of the form

15 Owner Drawn ListViews Use to display complex data
Multiple lines / columns Icons / Bitmaps Respond to key presses Implemented as a custom control

16 Owner Drawn ListViews Derive from Control class
OnKeyDown to trap current selection OnPaint for custom draw routine onto Bitmap object OwnerDrawnList Bitmap VScrollBar OnKeyDown OnPaint

17 Smartphone 2003 UI .NET Compact Framework enables rapid development
14 Inbuilt Controls for rich user interface Extensible using custom controls Workarounds for Input Modes, Scrolling and Owner ListViews

18 + .NET Compact Framework,
Windows Mobile Roadmap eVC 3 (C++) eVC 4 (C++) VS .NET 2003 (C#, VB.NET) eVC 3 (C++) eVB 3 (VB) eVC 3 (C++) eVB 3 (VB) VS 2005 (C#, VB.NET, C++) Tools Devices PPC 2000 PPC + PE v Next VGA, Landscape, Square, Standard SP v Next QVGA, Standard PPC + PE 2002 SP 2002 PPC + PE 2003 SP 2003 Platforms + .NET CF Whidbey, New native runtimes, 1st class managed code, Notification Manager, DirectX, Location APIs, Dr Watson + .NET Compact Framework, Bluetooth, SMS Win32, POOM + MFC, Connection Manager APIs CE OS 3.0 3.0 4.2 Macallan

19 Futures From the PDC In the OS For the developer
eDB – a step forward from CEDB Location Services API Update to WebServer (ASP support) Pocket Watson DirectX (D3D, modular Media Player) For the developer Combined IDE for Native and Managed Mobile SOAP toolkit .NET CF V2 development COM Interop, XPath, Crypto, Registry, Generics etc. Hosting Interface New Libraries System.Messaging Unified Notifications POOM – SMS, Mail, Calendar, Tasks etc. Telephony, all Phone related functions

20 Hardware Futures Displays Form Factors Multiple-Radios
Pocket PC Portrait/Landscape support Pocket PC Square Screen Pocket PC VGA Smartphone QVGA Form Factors Hybrid devices Pocket PC softkey support Multiple-Radios GSM/GPRS CDMA/1xRTT WiFi (802.1x) Bluetooth Location Services

21 SQL CE Futures Laguna code name for SQL CE 3.0 Runtime Improvements:
Performance – remove OLEDB for managed code Re-use spent storage pages Query hints Updateable scrollable cursors. Multi User Tools: Integration to Workbench DTS Data Designer in Whidbey

22 Summary Windows Mobile 2003 offers a rich and robust platform on which to build and deploy Mobile applications. Microsoft Visual Studio .NET 2003 provides state of the art development tools for targeting the Compact Framework. The Compact Framework brings Mobile devices to the mainstream development community.

23 © 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 Managed Code for Smartphone 2003"

Similar presentations


Ads by Google