Download presentation
Presentation is loading. Please wait.
Published byRoger Barnett Modified over 8 years ago
1
Building.NET Mobile Applications Mike Pelton MPelton@microsoft.com Developer & Platform Group Microsoft Ltd.
2
.NET…? Software technology for connecting your world of People, Information, Systems, and Devices
3
Web services Industry standards for interoperability Enable disparate systems to work together Enable disparate systems to work together Across languages, platforms, applications Computer to computer Inside/outside the firewall Based on open, internet standards Based on open, internet standards XML, SOAP, WSDL, UDDI Broad industry support Broad industry support Key area of vendor alignment
4
Web Services Factoring Business Logic
5
The Ever- Broadening Spectrum of Devices New Business Models New Business Models Using XML Web services Using XML Web services New models for user interaction New models for user interaction
6
Hardware Trends Cheaper, lighter, smaller… Cheaper, lighter, smaller… More integrated wireless More integrated wireless GPRS, WiFi… New Form factors New Form factors
7
Display USB or Serial Processor Memory GSM/GPRS CDMA/1xRTT Device Hardware WiFi Bluetooth Radio Drivers Windows Mobile CE DB ActiveSync Pocket Outlook Pocket Internet Explorer Windows Media Player Windows CE Software Platform (APIs) Home Screen User Interface/Shell HTML Control GAPI Remote API Configuration Bluetooth Connection Manager TAPI SMS MAPI POOM Multimedia Communication Device Management Presentation ADO CE XML CE DB OLE DB Data Access Native Win32 MFCATL Managed.NET Compact Framework Server side ASP.NET Mobile Controls Native Win32 MFCATL Managed.NET Compact Framework Server side ASP.NET Mobile Controls Windows Mobile Development Platform Embedded VC++ Visual Studio.NET
8
Building Mobile Web Applications Visual Studio and ASP.NET Mobile Controls Common Language Runtime Base Class Libraries ADO.NET and XML ASP.NET Web Forms WebServicesWindowsForms Visual Basic C++C#J#… Visual Studio.NET Mobile Web Programmability Integrated IDE Integrated IDE Visual design and debugging Visual design and debugging Simple integration with data and XML Simple integration with data and XML ASP.NET Mobile Controls Feature of ASP.NET Feature of ASP.NET Adaptive rendering for device properties Adaptive rendering for device properties Uses full.NET Framework Uses full.NET Framework
9
Key Concepts Two Sides of the Same Coin Adaptive rendering Adaptive rendering Mobile controls and device adapters generate an appropriate rendering for each device automatically Customisation Customisation Programmatic model to customise the rendering for a particular device. Why?
10
Building Mobile Web Applications The Adaptive Rendering Process 1. HTTP request 2. ASP.NET processing 3. ASP.NET result 4. Adaptive response Returned as proper browser protocol HTML HTML cHTML cHTML WML WML XHTML XHTML Render ASPX page Process page Process page Each control builds its own layout Each control builds its own layout Discover device capabilities Height and width Height and width Color Color Images Images Phone call ability Phone call ability
11
A Brief Aside… Cookieless Sessions Session State no longer requires client cookie support for SessionID Session State no longer requires client cookie support for SessionID Can optionally track SessionID in URL Requires no code changes to the application Requires no code changes to the application All relative links continue to work
12
Cookieless Sessions How To… 1. Create/Edit “web.config” file in the vroot 2. Add following text:
13
Adaptive Rendering
14
Device Support – 200+ Devices ACCESS Compact: NetFront 2.0, Fujitsu F503i, Mitsubishi D502i, Mitsubishi D503i, NEC N210i, NEC N502i, Sony SO503i ACCESS Compact: NetFront 2.0, Fujitsu F503i, Mitsubishi D502i, Mitsubishi D503i, NEC N210i, NEC N502i, Sony SO503i Ericsson 2.0: Ericsson R380, Ericsson R320, Ericsson R520m, Ericsson T20s Ericsson 2.0: Ericsson R380, Ericsson R320, Ericsson R520m, Ericsson T20s GoAmerica Go.Web: Compaq iPAQ H3650, Palm Vx, RIM Blackberry 857, RIM Blackberry 950, RIM Blackberry 957, GoAmerica Go.Web: Compaq iPAQ H3650, Palm Vx, RIM Blackberry 857, RIM Blackberry 950, RIM Blackberry 957, Microsoft Mobile Explorer: Sony CMD-Z5, Sony CMD-J5, Benefon Q, Microsoft Mobile Explorer: Sony CMD-Z5, Sony CMD-J5, Benefon Q, Microsoft Pocket Internet Explorer: Casio Cassiopeia E-125, Compaq iPAQ H3630, Compaq iPAQ H3650, HP Jornada 720, Compaq iPAQ H3670 Microsoft Pocket Internet Explorer: Casio Cassiopeia E-125, Compaq iPAQ H3630, Compaq iPAQ H3650, HP Jornada 720, Compaq iPAQ H3670 Nokia: Nokia 3330, Nokia 6210, Nokia 7110, Nokia 9110i Nokia: Nokia 3330, Nokia 6210, Nokia 7110, Nokia 9110i Openwave UP.Browser 3.x: Audiovox CDM-9000, Ericsson R280LX, Hitachi C407H, Kyocera QCP 2035A, Kyocera QCP 3035, LG V111, Mitsubishi T250, Motorola StarTAC 7868W, Motorola TimePort P8767, Samsung SCH-6100, Samsung SCH-850, Samsung SCH-8500, Samsung UpRoar M100, Sanyo C401SA, Sanyo SCP-4500, Sanyo SCP-5000, Sprint Touchpoint, Sprint Touchpoint 2200, Sprint Touchpoint 3000 Openwave UP.Browser 3.x: Audiovox CDM-9000, Ericsson R280LX, Hitachi C407H, Kyocera QCP 2035A, Kyocera QCP 3035, LG V111, Mitsubishi T250, Motorola StarTAC 7868W, Motorola TimePort P8767, Samsung SCH-6100, Samsung SCH-850, Samsung SCH-8500, Samsung UpRoar M100, Sanyo C401SA, Sanyo SCP-4500, Sanyo SCP-5000, Sprint Touchpoint, Sprint Touchpoint 2200, Sprint Touchpoint 3000 Openwave UP.Browser 4.x: Alcatel One Touch 701, Audiovox CDM-135, Audiovox CDM-9100, Motorola i1000plus, Motorola i2000plus, Motorola i50sx, Motorola i85s, Motorola T2288, Motorola TimePort P7382i, Motorola TimePort P7389, Motorola V100, Motorola V120c, Motorola V2288, Motorola V60c, Siemens C35i, Siemens S35i, Siemens SL45 Openwave UP.Browser 4.x: Alcatel One Touch 701, Audiovox CDM-135, Audiovox CDM-9100, Motorola i1000plus, Motorola i2000plus, Motorola i50sx, Motorola i85s, Motorola T2288, Motorola TimePort P7382i, Motorola TimePort P7389, Motorola V100, Motorola V120c, Motorola V2288, Motorola V60c, Siemens C35i, Siemens S35i, Siemens SL45 Miscellaneous Browsers: Handspring Visor Platinum (Qualcomm Eudora Internet Suite 2.1; Blazer 1.0 and Omnisky 2.1.0.15), IBM WorkPad c505 (ilinx Xiino 1.01J), Kyocera QCP 6035 (Qualcomm Eudora 2.0), Nokia 9210 (Symbian Crystal 6.0), Palm VII (MyPalm 1.0), Palm Vx (AU-Systems 2.12181.1 and Omnisky 2.0.04), Palm m505 (MyPalm 1.1), Panasonic P210i, Panasonic P502i, Sharp J-SH04 (Original Equipment Manufacturer's Version 3.0), Sharp Zaurus MI-E1 (Original Equipment Manufacturer's Version 6.1), Sony CLIE PEG-N700C (ilinz Palmscape 4.0SJ), Toshiba J-T05 (Original Equipment Manufacturer's Version 3.0), Miscellaneous Browsers: Handspring Visor Platinum (Qualcomm Eudora Internet Suite 2.1; Blazer 1.0 and Omnisky 2.1.0.15), IBM WorkPad c505 (ilinx Xiino 1.01J), Kyocera QCP 6035 (Qualcomm Eudora 2.0), Nokia 9210 (Symbian Crystal 6.0), Palm VII (MyPalm 1.0), Palm Vx (AU-Systems 2.12181.1 and Omnisky 2.0.04), Palm m505 (MyPalm 1.1), Panasonic P210i, Panasonic P502i, Sharp J-SH04 (Original Equipment Manufacturer's Version 3.0), Sharp Zaurus MI-E1 (Original Equipment Manufacturer's Version 6.1), Sony CLIE PEG-N700C (ilinz Palmscape 4.0SJ), Toshiba J-T05 (Original Equipment Manufacturer's Version 3.0),
15
IIS.NET Framework Mobile Internet Toolkit Development Environment Production Create mobile Web Form Integrate Business Logic MobilePresentation Layer (controls) Layer (controls) Test Target Devices Post to Web Servers HTTPRequestDeviceCapabilities Mobile Controls and Device Adapters generate display Add Device Adapters Update Device Capabilities HTTPResponse Mobile.aspxPages The Lifecycle
16
Customising for Particular Devices Why? Optimise the generated rendering Optimise the generated rendering Per device or class of device Used on a per application basis Comparison- or Evaluator-based filters Control the exact display Control the exact display Ability to override default behavior Ability to override default behavior
17
Customisation - Templates ObjectList Control HeaderTemplate Item Template AlternateItemTemplate FooterTemplate SeparatorTemplate Pocket PC Customisation Cell Phone Limited Customisation ItemDetailsTemplate DataBinder.Eval(((ObjectListItem)Container).DataItem, “FirstName”)
18
Using XML Web Services and the Object List
19
Case Study: Tesco.com Re-use of existing skills Re-use of existing skills Very rapid delivery Very rapid delivery New business model New business model Increased customer satisfaction and profitability Increased customer satisfaction and profitability
20
Building Smart Device Applications Visual Studio.NET and.NET Compact Framework Common Language Runtime Base Class Libraries ADO.NET and XML ASP.NET Web Forms WebServicesWindowsForms Visual Basic C++C#J#… Visual Studio.NET Smart Device Programmability Targets.NET Compact Framework Targets.NET Compact Framework Integrated IDE Integrated IDE Emulators Emulators Remote debugging Remote debugging.NET Compact Framework Managed code Managed code Web services Web services Rich subset of.NET Framework Class Libraries Rich subset of.NET Framework Class Libraries
21
Execution Engine Overview Verifiable type safe execution Verifiable type safe execution Garbage collection Garbage collection JIT compilation JIT compilation Error handling with exceptions Error handling with exceptions Common type system Common type system Platform Invocation Platform Invocation
22
XML Web Services Support Calling XML Web services Calling XML Web services All encoding types All encoding types Synchronous and asynchronous invocation Synchronous and asynchronous invocation Basic and Digest authentication Basic and Digest authentication Secure Sockets Layer support for encryption (SSL) Secure Sockets Layer support for encryption (SSL) Custom SOAP headers Custom SOAP headers SOAP Extension Framework SOAP Extension Framework
23
Building Smart Device Apps Remote Debugging Same user experience as desktop Same user experience as desktop Compile application for device Automatically deploys to selected device Output Window used for deployment messages Supported features include Supported features include On-device debugging Breakpoints Multi-language debugging Call Stack, Watch windows Command window – Immediate
24
A Simple Compact Framework Application
25
Building Smart Device Applications SQL Server ™ Windows ® CE Edition 2.0 On-device data engine for Windows CE- powered devices On-device data engine for Windows CE- powered devices Rich replication and synchronisation with SQL Server Rich replication and synchronisation with SQL Server Designed for high performance in resource-constrained environments Designed for high performance in resource-constrained environments Managed.NET Compact Framework provider Managed.NET Compact Framework provider
26
OLEDB CE CLR /.NET CF QP/Cursor Engine/ES Data Access Storage Architecture Client Agent: Replication andRDA OLEDB / Replication API IIS CLIENT SERVER Storage Engine / Repl Tracking SQL CE Edition v2.0 OLEDB OLEDB Server Agent: Replication and Remote Data Access HTTP XML/BizTalk/CS 2002 802.11b, Cellular Digital Packet Data, Global System Mobile Comms, Code Division Multiple Access, Time Division Multiple Access, Time Division Multiple Access, etc. etc. DataCentre SQL Server CE Data Provider Data Provider SQL Server Client Data Provider ADO.NET VS.NET (VB.NET, C#).NET CF / Managed Stack TDS Ethernet Well Connected Occasionally Connected
27
Setting up Replication Create a Publication in SQL Server Create a Publication in SQL Server Configure a virtual root using the SQL CE tools Configure a virtual root using the SQL CE tools Create a subscription database on the smart device Create a subscription database on the smart device Use the SqlCeReplication class Create a subscription to the published data Create a subscription to the published data Call.AddSubscription Call.Synchronize http://smartdevices.microsoftdev.com/Learn/Articles/619.aspx
28
Synchronising off-line data: The “IBuySpy Delivery” application
29
New MSDN Articles: Compact Framework Accessing Phone APIs from the Microsoft.NET Compact Framework http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfPhoneAPI.asp Obfuscating Smart Device Applications http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfObfuscation.asp Marshalling Types During Platform Invoke on the Microsoft.NET Compact Framework http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfMarshallingTypes.asp Microsoft.NET Compact Framework Multi-threading Tips http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfMultiThreadedApp.asp Writing Unmanaged Functions for Microsoft.NET Compact Framework-based Applications http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/unmanagedFuncs.asp Programming Merge Replication with the Microsoft.NET Compact Framework http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfMergeReplication.asp Microsoft.NET Compact Framework-based DateTimePicker Control http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfDateTimePicker.asp
30
Mobile Application Approaches Architectural Advantages Offline functionality Offline functionality Local execution Local data Rich user experience Rich user experience Multimedia Elaborate UI Integration with assets on the device Integration with assets on the device Credit card readers Barcode scanners GPS receivers Adaptive rendering Adaptive rendering Dynamic support for many device/browser combinations Support for low-end browser devices Single code base Single code base Simplified maintenance Natural extension to existing Web sites Server-side execution Server-side execution No client deployment No client execution Advantages of mobile Web apps Advantages of smart device apps
31
Architecture Guidance Microsoft patterns and practices Proven Proven Based on field and partner experience Authoritative Authoritative Best advice available Accurate Accurate Technically validated and tested Actionable Actionable Provide the steps to success Relevant Relevant Address real world scenarios Available online http://www.microsoft.com/practices
32
No-Touch Deployment Patterns and Practices Self-Update 1.0 AppStart.exe MyApp 1.1 AppStart.exe AppStart.config MyApp V1 Domain Web Server Check manifest for updates Download updates using BITS MyApp V1.1 Domain HTTP
33
Patterns and Practices Online/Offline Application XML Web service Smart Client Application Offline Application Block Service Agent Management Connection State Management Reference Data Management Message Data Management
34
Connection Detection UI Layer (view) Connection Manager (model)ControllerConnectionDetectionStrategy Creates Registers for notificationfrom Utilizes DeterminesPhysicalConnectionPresence StateChanged:GoingOffline Service Agent Conn State Ref Data Message Data
35
The Other End of the Spectrum - Tablet PC Windows XP Tablet PC Edition Windows XP Tablet PC Edition Windows XP Professional Windows Journal Utility Handwriting Reco Engine Text Input Panel Speech Reco Engine Sticky Notes Gesture APIs Gesture Reco engine Stylus Drivers Ink Controls
36
Ink Ink as Ink Ink as Ink Ink is not a bitmap Serialise as Binary (ISF) XML Image RTF (Clipboard) Always stored as Ink Use the Ink Collector Ink as Text Ink as Text Controls convert input Input saved as text
37
Controls InkEdit InkEdit Super-class of Rich Edit control Win32,.NET, ActiveX versions Intended for text and ink-to-text scenarios Works well in Forms scenarios InkPicture InkPicture Similar to InkCollector Allows ink annotations on images in.jpg,.bmp,.png, or.gif format .NET, ActiveX version Can be hosted in WinForms or IE Can be hosted in WinForms or IE
38
Understanding Gestures What is a gesture? What is a gesture? Anything you can do with a pen Similar to keyboard shortcuts – e.g. ”Ctrl C” System Gestures System Gestures Gestures supported by the Operating System by default To be notified subscribe to the ‘SystemGesture’ event 14 gestures, examples: Tap, Double-tap, Drag Application Gestures Application Gestures Gestures your application can choose to support To be notified Subscribe to the ‘Gesture’ event Advise the platform of the specific gestures your app wants 38 gestures, examples: Scratchout, Scroll up, Scroll down Gestures have confidence levels
39
The Tablet PC SDK: Controls Gestures
40
© 2003 Microsoft Limited. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.