Microsoft Smartphone 2002 Development - PowerPoint PPT Presentation

1 / 48
About This Presentation
Title:

Microsoft Smartphone 2002 Development

Description:

Create a CAB file using CABWizSP under the SDK Tools directory ... Designer adds controls to code in reverse order. Security And Managed Code. ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 49
Provided by: downloadM
Category:

less

Transcript and Presenter's Notes

Title: Microsoft Smartphone 2002 Development


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
Smartphone 2002 OS
6
WinCE Controls
Not Recommended
Supported
  • 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

Not Supported
New Controls
7
Smartphone User Interface
  • Form factor require control changes
  • Menus
  • Multiline Text Edit
  • Listboxes
  • Stylus / SIP Input

Softkeys Expandable Edit Spinners Input Mod
es
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\ 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 szVolumeFileMAX_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
  • Based on TAPI, with extensions for GSM-specific
    functionality
  • One simple API to make a voice call
  • tapiRequestMakeCall

21
Voice Calls Example 1
  • include
  • LONG result
  • result tapiRequestMakeCall(TEXT(18005551212),
    NULL NULL, NULL)
  • if (result ! 0)
  •     // Insert error handling code here

22
Voice Calls Example
  • include
  • 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

23
Changing Input Modes
//Set input mode to multitap SendDlgItemMessage(
hDlg, IDC_CONTROL, EM_SETINPUTMODE, 0,
EIM_SPELL) //Set input mode to numeric SendDl
gItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE,
0, EIM_NUMBERS) //Set input mode to T9 SendDl
gItemMessage(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 SendDl
gItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE,
0, EIM_NUMBERS) //Set input mode to T9 SendDl
gItemMessage(hDlg, IDC_CONTROL, EM_SETINPUTMODE,
0, EIM_AMBIG)
24
Dialler App
Introduction to Telephony
25
Application Security and Deployment
26
Smartphone Security
  • Devices can be configured by the operator

Unlocked device
Locked device 1
Locked device 2
27
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

28
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

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

30
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

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

CABWizSP
Application Package (.CAB)
Your Files
Information File (.inf)
32
Application Management Distribution
  • Choose a channel to distribute your application
  • Use Mobile2Market to increase distribution
    channels
  • http//www.microsoft.com/mobile/developer/develope
    rprograms/mobile2market/default.asp
  • Choose a transport to distribute your
    application
  • Pocket Internet Explorer
  • Email attachment
  • Storage card
  • ActiveSync

33
Create a Package
34
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

35
.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

36
NETCF Supported ControlsPocket PC and Windows
CE.NET
  • Supported controls
  • Button
  • CheckBox
  • ComboBox
  • ContextMenu
  • DataGrid
  • DomainUpDown
  • FileOpenDialog
  • HScrollBar
  • ImageList
  • Label
  • ListBox
  • ListView
  • TreeView
  • FileSaveDialog

MainMenu NumericUpDown Panel PictureBox Progre
ssBar RadioButton StatusBar TabControl TextBox

Timer ToolBar VScrollBar MessageBox Form


37
NETCF Supported ControlsSmartphone
  • Supported controls
  • Button
  • CheckBox
  • ComboBox
  • ContextMenu
  • DataGrid
  • DomainUpDown
  • FileOpenDialog
  • HScrollBar
  • ImageList
  • Label
  • ListBox
  • ListView
  • TreeView
  • FileSaveDialog

MainMenu NumericUpDown Panel PictureBox Progre
ssBar RadioButton StatusBar TabControl TextBox

Timer ToolBar VScrollBar MessageBox Form


38
Smartphone Controls
  • TextBox
  • .Multiline True MLE Control
  • .Multiline False Edit Control

39
Smartphone Controls
  • ComboBox
  • Action to view all items full screen

40
Smartphone Controls
  • TreeView
  • Recommended Full Screen
  • No CheckBoxes on Smartphone
  • ListView
  • Recommended Full Screen

41
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

42
Home Key
  • Home Key returns to home screen
  • No KeyPress event thrown
  • So Home Key cant be overridden

43
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

44
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

45
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

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

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

48
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

49
Remember To Fill Out This Sessions Evaluation!

50
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com