1 / 48

Microsoft Smartphone 2002 Development

Microsoft Smartphone 2002 Development. Agenda. Smartphone Hardware Smartphone OS Smartphone User Interface Development Tools Application Security & Deployment Working with Telephony .NET Compact Framework. Smartphone 2002 Hardware. 120MHz ARM processor

urbain
Download Presentation

Microsoft Smartphone 2002 Development

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. Microsoft Smartphone 2002 Development

  2. Agenda • Smartphone Hardware • Smartphone OS • Smartphone User Interface • Development Tools • Application Security & Deployment • Working with Telephony • .NET Compact Framework

  3. Smartphone 2002 Hardware • 120MHz ARM processor • 16MB RAM for application execution and temporary storage • 32MB flash ROM for OS and permanent data storage • 176x220 16-bit colour display

  4. Storage and Memory • ROM (~24MB) • Permanent content from Microsoft, OEM, and Operator provided applications. • Can be updated over-the-air. • Flash (~8MB) • Permanent data storage for application data, registry, and files, and databases. • Survives power loss, reboots, etc. • RAM (~16MB) • Application execution and radio. • Cleared on power off and reboot.

  5. Dialler Control Panel Home Screen Inbox Apps / UI Connection Manager Toolkit Sync Engine Logic TAPI Threading Networking SIM Winsock WAP CryptoAPI SMS CE 3.0 Core APIs CDMA GSM Radio Stack SIM Smartphone 2002 OS

  6. CheckBox DatePicker Edit Header Listbox Listview Progress Scrollbar Static Status Trackbar Treeview Buttons Radio Buttons Combo box Month Calendar Property Sheets/Pages Toolbar Expandable Edit Multi-Item Picker WinCE Controls Supported Not Recommended Not Supported New Controls

  7. Smartphone User Interface Softkeys Expandable Edit Spinners Input Modes • Form factor require control changes • Menus • Multiline Text Edit • Listboxes • Stylus / SIP Input

  8. Softkeys • Left softkey is most common action • Right softkey is a menu • Items are listed in desktop-style order • Items never have ellipses (…) • Dialogs have “Done” on the left softkey and “Cancel” on the right (if necessary)

  9. Edit Controls • Edit controls support multiple input methods • Typically the methods available will be numeric, multi-tap, and T9 • Multi-line edit controls support zooming in for a larger view

  10. Spinner Control • Replaces combo boxes, radio buttons, and list boxes • Multi-item selection available

  11. Typical Application Flow • List view -> card view -> edit view • Contacts is a classic example

  12. Development Tools • eMbedded Visual C++ 3.0 • Smartphone 2002 SDK • Emulator • No MFC / ATL • No eVB • Remote Tools • Registry Viewer • Process Viewer • File Viewer

  13. Useful Code Samples

  14. Finding the Persistent Storage Path • To persist data, it must be stored in the registry or under in persistent storage directory • Use SHGetSpecialFolderPath() for root path • CSIDL_APPDATA\<appname> for files internal to your app • CSIDL_PERSONAL for files the user needs to work with (“My Documents”) • Data stored in RAM file system will be lost on power off

  15. Finding the Persistent Storage Path TCHAR szVolumeFile[MAX_PATH]; if(!SHGetSpecialFolderPath(NULL, szVolumeFile, CSIDL_APPDATA, TRUE)) { ASSERT(FALSE); hr = HRESULT_FROM_WIN32(GetLastError()); return 0; } // szVolumeFile - \IPSM\Application Data

  16. Creating Softkeys and Handling Back • Softkeys are just PocketPC menu bars that only have two items • Send a message to the menu bar to request messages for the back key

  17. Creating Softkeys and Handling Back #define TPC //Create a MenuBar SHMENUBARINFO mbi; memset(&mbi, 0, sizeof(SHMENUBARINFO)); mbi.cbSize = sizeof(SHMENUBARINFO); mbi.hwndParent = hParent; mbi.nToolBarId = IDM_MAIN_MENU; mbi.hInstRes = g_hInst; mbi.nBmpId = 0; mbi.cBmpImages = 0; // Create the menu bar if (!SHCreateMenuBar(&mbi)) { MessageBox(hParent, TEXT("SHCreateMenuBar Failed"), TEXT("Error"), MB_OK); return false; }

  18. Creating Softkeys and Handling Back // Request notifications for the back key SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY));

  19. Creating Softkeys and Handling Back // Handle the back key in the main window proc LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) { switch (uMessage) { … case WM_HOTKEY: { if((VK_TBACK == HIWORD(lParam)) { // Send back key to control with focus SHSendBackToFocusWindow(message, wParam, lParam); } } } }

  20. Voice Calls Example #include <phone.h> PHONEMAKECALLINFO mci; int result; memset(&mci, 0, sizeof(mci)); mci.cbSize = sizeof(mci); mci.dwFlags = PMCF_PROMPTBEFORECALLING; mci.pszDestAddress = TEXT(“+18005551212"); result = PhoneMakeCall(mci); if (result != 0) {     // Insert error handling code here }

  21. Changing Input Modes //Set input mode to multitap SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_SPELL); //Set input mode to numeric SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_NUMBERS); //Set input mode to T9 SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_AMBIG); //Set input mode to multitap SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_SPELL); //Set input mode to numeric SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_NUMBERS); //Set input mode to T9 SendDlgItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0, EIM_AMBIG);

  22. Dialler App Introduction to Telephony

  23. Application Security and Deployment

  24. Any Cab Any Cab Any Cab Any Exe Any Exe Any Exe Trusted Cab Trusted Exe Signed Cab Signed Cab Signed Exe Signed Exe Smartphone Security • Devices can be configured by the operator Unlocked device Locked device 1 Locked device 2

  25. Application Management Execution • Two modes of execution • Unprivileged – has access to most APIs, registry keys, and files • Privileged – has access to everything • Modes allow operators to protect sensitive areas of the device and network

  26. Application Management Execution • When do you need privileged? • Inbox plugins • Intercept SMS messages • Device drivers • How do you get privileged? • On a test device: sign with a test cert • On a shipping device: get signed with an operator cert

  27. Debugging Applications • To debug against device need to sign files and provision device for cert.

  28. Packaging Process • Create a CAB file using CABWizSP under the SDK \Tools directory • Create an INF file detailing application and company details, files to copy, shortcut creation CABWizSP Application Package (.CAB) Your Files Information File (.inf)

  29. Packaging Process • To enable security signed applications • Sign the Exe and Cab using Signcode.exe CABWizSP Application Package (.CAB) Your Files Information File (.inf)

  30. Application Management Distribution • Choose a channel to distribute your application • Use Mobile2Market to increase distribution channels • http://www.microsoft.com/mobile/developer/developerprograms/mobile2market/default.asp • Choose a transport to distribute your application • Pocket Internet Explorer • Email attachment • Storage card • ActiveSync

  31. Create a Package

  32. Smartphone Futures • Microsoft are committed to the platform • V. Next release • Based on Win CE 4.2 • Compact Framework 1.0 in ROM • ATL Support • JIT Debugging • RTTI / Exception Handling

  33. .NET Compact Framework 1.0 For Smartphone • Will be a feature of next version of Smartphone • New UI Support • ROM - only – no CAB Install of Framework • Managed apps follow native security model • Added support for 5 new languages • Dutch, Danish, Swedish, Portuguese Brasilia, UK English • Multilingual User Interface (MUI) Support • Entire v1 feature set supported • SQL Server CE not supported

  34. Button CheckBox ComboBox ContextMenu DataGrid DomainUpDown FileOpenDialog HScrollBar ImageList Label ListBox ListView TreeView FileSaveDialog Supported controls NETCF Supported ControlsPocket PC and Windows CE.NET MainMenu NumericUpDown Panel PictureBox ProgressBar RadioButton StatusBar TabControl TextBox Timer ToolBar VScrollBar MessageBox Form

  35. Button CheckBox ComboBox ContextMenu DataGrid DomainUpDown FileOpenDialog HScrollBar ImageList Label ListBox ListView TreeView FileSaveDialog Supported controls NETCF Supported ControlsSmartphone MainMenu NumericUpDown Panel PictureBox ProgressBar RadioButton StatusBar TabControl TextBox Timer ToolBar VScrollBar MessageBox Form

  36. Smartphone Controls • TextBox • .Multiline = True: MLE Control • .Multiline = False: Edit Control

  37. Smartphone Controls • ComboBox • Action to view all items full screen

  38. Smartphone Controls • TreeView • Recommended Full Screen • No CheckBoxes on Smartphone • ListView • Recommended Full Screen

  39. Soft Keys (Menus) • Left SoftKey can not have menu items • If there is no MainMenu on the form • SoftKey press raises KeyDown and KeyUp events • KeyEventArgs.KeyCode is Keys.F1 and F2

  40. Home Key • Home Key returns to home screen • No KeyPress event thrown • So Home Key can’t be overridden

  41. Back Key • Back Key navigates back to previous screen • Next window in z - order brought to front • Exceptions • Always cancels out of modal dialogs • Backspace when focus on Textbox • When menu showing cancels out of menu • Overriding Default Behavior • Set KeyPressEventArgs.Handled = true • Intended for custom controls or games

  42. Control Focus And Tabbing • Focus is critical to Smartphone UI model • Up and Down navigation keys switch between controls • Focusable Controls • CheckBox, ComboBox, ListView, TreeView, Form, TextBox • Tab order goes in order of focusable controls in controls collection • Custom Controls • Focusable unless Enabled property set to false • Developer must ‘tab out’ of their control by overriding the up/down keys and giving focus to next control • Designer Issue • Designer adds controls to code in reverse order

  43. Security And Managed Code • .NET Compact Framework adapts native application-level security model • Managed apps follow native security policy • Security check also done on P/Invoke call • Application must be signed with carrier approved cert to run on locked devices • Code Access Security will come in .NET Compact Framework 2.0 • More granular security, unique to .NET

  44. Application Architecture • Applies to Native and NETCF code Pocket PC UI Smartphone UI User Interface Application Engine Application Engine Utility Libraries Utility Libraries

  45. Smartphone Developer Kit • Exclusive to MSPP members (~550€) • eVT 3.0 • Smartphone 2002 SDK • Documentation • Whitepapers • Samples • Compal AR11 • SIM Unlocked • Security Unlocked

  46. Summary • eVC++ 3.0 to target Smartphone 2002 • Design your user interface • Left menubar is default action • Spinners • Expandable Edits • Keep as simple as possible • Your application may need signing • Compact Framework is coming

  47. Remember To Fill Out This Session’s Evaluation!

More Related