390 likes | 573 Views
Network and Connectivity for Windows Mobile Devices. Paul Yao The Paul Yao Company -> Microsoft Mobile DevCon Booth #744 <- http://www.paulyao.com. Managed. Managed. Server side. Server side. Native. Native. ASP .NET Mobile Controls. ASP .NET Mobile Controls. MFC. MFC. ATL. ATL.
E N D
Network and Connectivityfor Windows Mobile Devices Paul Yao The Paul Yao Company -> Microsoft Mobile DevCon Booth #744 <- http://www.paulyao.com
Managed Managed Server side Server side Native Native ASP .NETMobile Controls ASP .NETMobile Controls MFC MFC ATL ATL .NET Compact Framework .NET Compact Framework Win32 Win32 Software Platform (APIs) Data Access Device Management Communication Presentation Multimedia Remote APIConfigurationBluetooth Security Connection ManagerTAPISMS MAPI POOM ActiveSync ADO CEXMLCE DBOLE DB Home ScreenUser Interface/ShellHTML Control GAPI Windows Mobile CE DBActiveSync Pocket OutlookPocket Internet ExplorerWindows Media Player Windows CE Device Hardware Radio ProcessorMemory GSM/GPRSCDMA/1xRTT WiFiBluetooth DisplayUSB or Serial Windows Mobile Development Platform:Today Visual Studio .NET Embedded VC++ Drivers
Agenda • Part 1: Overview • Part 2: Connectivity Scenarios • Part 3: Connection Manager Download the slides for this session at: http://www.paulyao.com/MSMDC_CLI363.ppt
Part 1: Overview • The Connectivity Wheel • Network Categories • Networking & Connectivity APIs
The Connectivity Wheel Circuit Switched Data (e.g. GSM, CDMA) Packet Data (e.g. GPRS, 1xRTT) WAP SMS TCP/IP Cable Replacement 802.11 Bluetooth Desktop Pass-Through
Network Categories • Personal Area Network (PAN) • Wired – USB, serial • Wireless – Bluetooth, Infrared • Local Area Network (LAN) • Wired – Ethernet (TCP/IP), Token-ring • Wireless – 802.11b “WiFi”, 802.11a • Wide Area Network (WAN) • Wired – Plain Old Telephone System (POTS), The Internet • Wireless – Mobile phone networks (GSM/GPRS/CDMA)
Networking APIs (1/8)Windows Sockets 2.2 • TCP/IP connections • No asynchronous support (Windows message-based support) • IrDA connections • Bluetooth connections • Differences from previous versions • Multiple transport protocols • TCP/IPv4 • TCP/IPv6 • Multicast support • Overlapped I/O with scatter/gather • Secure socket
Networking APIs (2/8)Network Support • Windows Internet (WinInet) Services • HTTP clients • FTP clients • No Gopher protocol support • Autodial • Passport • Connection Manager • Container for network connection and configuration information • Supports connection policy
Networking APIs (3/8)ActiveSync Service Providers • Synchronization of device data with desktop • Examples: • Desktop Outlook with Pocket Outlook • Desktop database with device database • Elements • COM-based DLL on desktop • COM-based DLL on device • Enabled with registry settings
Networking APIs (4/8)Remote API (RAPI) • Available when device is connected via ActiveSync • Access to device data • File system • Registry • CE property databases • Load & run device-side exucutables: • CeCreateProcess – run program (.exe) file • CeRapiInvoke – load library (.dll) on device
Networking APIs (5/8)Web services • Formerly known as “XML Web services” • Client/Server Mechanism • Remote Procedure Call (RPC) • SOAP-compliant XML • Sent via HTTP/SMTP ports • Device Side • .NET Compact Framework supports Web service clients • Server Side • ASP.NET supports Web service servers
Networking APIs (6/8)Mobile Phone • Assisted Telephony • Phone API • Telephony API (TAPI) • Extended TAPI • Wireless Application Protocol (WAP) • Short Message Service (SMS) • Subscriber Identity Module (SIM) Manager
Networking APIs (7/8)User Interface Support • NETUI – dialog box library • GetIPAddress • ConnectionDialog • DisconnectDialog • GetUsernamePassword • Connection Setting Applet… • CreateProcess(L”remnet.exe”, …) • Summon ActiveSync: • CreateProcess(L”repllog.exe /remote”, …)
Networking APIs (8/8)Miscellaneous • Data Security • Cryptography API • Digital Certificates (X.509) • Secure Socket Layer (SSL 2.0 and 3.0) • Private Communications Technology (PCT) Protocol 1.0 • Dial-Up Networking • A.k.a. “Remote Access Service” (RAS) • Call ISP over modem • Establish PPP / SLIP connections • Use Connection Manager instead
Part 2: Connectivity Scenarios • Personal Area Network • Local Area Network • Wide Area Network
Personal Area NetworkActiveSync Connectivity • PAN / Direct connection • USB, serial • Infrared, Bluetooth • Passthrough • Network connection to device in cradle • Supports HTTP, HTTPS, IMAP, FTP, and POP3 • Does not support UDP, ICMP, or PPTP • Reference – article by Andreas Sjöström: • http://www.microsoft.com/mobile/developer/technicalarticles/passthrough.asp • Use ActiveSync 3.7 for Windows Mobile devices
Personal Area Network Developer Support • ActiveSync supports • Download / deployment • Debugging • *Tip* Developers can speed up download & debugging with an ActiveSync network connection • Emulator • Support ActiveSync • Requires network virtual switch • Refer to eVC++ 4.0 documentation
Local Area NetworkActiveSync • First: establish partnership via direct connection • Can synchronize over any LAN • Wireless: WiFi (802.11b), 802.11a • Wired: Ethernet, Token-ring • Exchange Server ActiveSync to server • *Tip* Developers can speed up download & debugging with an ActiveSync network connection (did I already say that?!?)
Local Area Network”My Work Network” • Can connect via modem • Virtual Private Network • Need host name –or- IP address • VPN Types: • IPSec/L2TP – need certificate –or- pre-shared key • PPTP – need user name/password • Can have proxy settings • HTTP • WAP • Secure WAP
Local Area NetworkWhat is it good for? • Access to any IP-enabled network service or server • Fun with HTML • Browse WWW, local web servers • Fun with XML • Web service client • Web service server • Fun with TLAs (three-letter acronyms…) • FTP, SSL, VPN, PPTP • Network PPP • Network redirector - SMB protocol • File Servers • Print Servers
Local Area NetworkConnect Visual Studio .NET • Use ActiveSync • Establish partnership via USB/serial • Download & Run • Starts device-side conmanclient.exe • Configure TCP/IP Transport • Tools->Options… • [Device Tools][Devices]“Pocket PC Device”, • Click [Configure…] • Options: • Auto IP address • Static IP address IP address from ActiveSync Set static address on device
Local Area NetworkDownload/Debug – eVC++ (no DHCP) • Establish partnership via USB/serial • Static IP address on desktop • Static IP Address on smart device • Set WINS address to desktop IP address • Start->Settings-> [Connections][Network] [Adapters]<Select Adapter>[Name Servers]
Local Area NetworkDownload/Debug – eVC++ (w/ DHCP) • Desktop-Side • Enable network connections • Connect via USB/serial • Device-Side • Enable network connections in ActiveSync • Enable DHCP for network adapter • Attach network adapter • Might need to reset device • Connect to Network • Wired • Wireless
Public Network Support • Connect via: • Dial-in modem • Internet PPTP connection • ActiveSync WAN Connection • VPN / PPTP connection to desktop • Exchange Server ActiveSync to server • Networks • Internet – WWW, http, https: • WAP – wsp://, wsps: • GSM / GPRS / CDMA
Public Mobile Phone NetworkWAP Protocol • Wireless Datagram Protocol (WDP) • SMS or UDP Transports • Application Wake up (PPC2003 only) • WDP Phase 1 support • datagrams may originate from the internet
Public Mobile Phone NetworkShort Message Service (SMS) • Used for short messages • Length is air link dependent • Capable of message concatenation • APIs • #include <sms.h> • SmsOpen(…); • SmsSendMessage(…); • SmsClose(…);
Part 3: Connection Manager • Overview • Network Model • Configuration • Configuration Service Providers (CSPs) • API Support
Connection ManagerOverview • Umbrella for Network Address Resolution • Voice • Data – Internet, WAP, etc. • Configuration Service Providers (CSP) • Manage service-specific, low-level settings • GPRS settings, Data networks, URL mapping • Connections for: PPP, Proxies, VPN, WiFi • Decide optimal route for connections • Based on ‘cost’ criteria provided by CSPs • Can manage multi-hop connections
VPN MS Redmond RAS Cingular ISP The Internet My Corporate Network Proxy MS Paris RAS Earthlink ISP msw red-msg-06 WAP Gateway Yahoo.com mail.earthlink.net WAP Network wap.ananova.com Connection ManagerNetwork Model
Connection ManagerConfiguration (1/2) • Who can configure • End user • Corporate IT Dept • Mobile phone service provider • Default Networks • The Internet • Work • The WAP Network • Secure WAP Network • Pocket PC Adds • My Work Network • My ISP
Burn into device ROM Send in CAB provisioning format (.cpf) file Install in cradle using rapiconfig.exe C> rapiconfig mydoc.xml Send using Wireless Application Protocol (WAP) Push Message Over-the-air (OTA) protocol Provisioning XML File <wap-provisioningdoc> <characteristic type="CM_Networks"> <characteristic type="The Internet"> <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/> </characteristic> </characteristic> </wap-provisioningdoc> Connection ManagerConfiguration (2/2)
Connection ManagerConfiguration Service Providers (CSP) Connection Manager UI Application XML Provisioning Document Configuration Manager URL Mapper Planner Connection Manager Engine etc RAS Proxy PPTP GPRS Voice CSPs
Connection ManagerAPI Support (1/2) • ConnMgrMapURL() • Fetch preferred network for a given URL • Allows applications to query for network policy • Default mapping: • *:\\*.*\ - The Internet • *:\\*\ - Private network (intranet) • wsp:\\ - WAP network • wsps:\\ - Secure WAP network
Connection ManagerAPI Support (1/2) • ConnMgrEstablishConnection() • Creates asynchronous request for connection • ConnMgrConnectionStatus() • Query connection status • ConnMgrEstablishConnectionSync() • Creates synchronous request for connection • ConnMgrReleaseConnection() • Disconnect when finished using network
After This Session… • Visit the Windows Mobile booth to: • Get the Windows Mobile Developer Resource Kit and start supporting landscape and high DPI • Talk to the Technical Support team • Join the Windows Mobile Solutions Partner Program • Enter the Microsoft Mobile2Market Application Contest • Fill in your evaluation form sponsored by AT&T Wireless • 1 MPX200 given away per session. See www.mscorpevents.com/mdc
Thank You!Download the slides for this session at: http://www.paulyao.com/MSMDC_CLI363.ppt
© 2004 Microsoft Corporation. All rights reserved. MICROSOFT CONFIDENTIAL. INTERNAL USE ONLY.