Download presentation
Presentation is loading. Please wait.
Published byVivian Watts Modified over 9 years ago
1
.NET Compact Framework Per Ahlberg
2
Agenda.NET CF vs.NET Framework Major Areas Base Classes Drawing/Forms Data/XML Web Services Application Development Emulation and deployment Communication and data Security
3
Agenda.NET CF vs.NET Framework Major Areas Base Classes Drawing/Forms Data/XML Web Services Application Development Emulation and deployment Communication and data Security
4
The Mobile Device Universe Infrastructure Servers, e.g. Network Operators Tools XML Web Services Clients User Experiences & Solutions AuthenticationSMSVoice Calls Subscriber DBMMSData Calls PersonalizationBillingetc…
5
A large number of devices…
6
code web pages Visual Studio.NET 2003.NET Framework Mobile Web Browser.NET Compact Framework client-side applications web applications Application models for devices
7
Making Applications Mobile Mobility involves more than just being wireless Truly mobile applications go anywhere Data useful when offline State of connectedness transparent to user and/or application
8
.NET CF design goals Compatibility Strict compatibility with.NET Framework Subset functionality Subsetting for devices Give the developer a known target Enable skills and code transfer Size/functionality Provide critical mass needed for “real apps”.NET Compact Framework.NET Framework
9
.NET Compact Framework Lightweight version of.NET Framework Designed for resource-constrained devices Compatible with VS.NET, C#, VB.NET Runs applications securely on-device High performance JIT compiler Guarantees robustness and security Highly interactive, offline, and networked experiences Makes it easy to consume web services Tuned for size and performance
10
System System.DataSystem.Xml System.Web Globalization Text Security Collections Resources Reflection Net IO Threading Diagnostics ServiceProcess Configuration Design ADO.NETSqlClient Xslt/XPath XmlDocument Runtime InteropServices Remoting Serialization ConfigurationSessionState CachingSecurity Services Description Discovery Protocols UI HtmlControls WebControls System.Drawing Imaging Drawing2D Text Printing System.WinForms DesignComponentModel Reader/Writers.NET Framework
11
System System.DataSystem.Xml System.Web Globalization Text Security Collections Resources Reflection Net IO Threading Diagnostics ServiceProcess Configuration Design ADO.NET SqlServerCe SqlClient Xslt/XPath XmlDocument Runtime InteropServices Remoting Serialization ConfigurationSessionState CachingSecurity Services Description Discovery Protocols UI HtmlControls WebControls System.Drawing Imaging Drawing2D Text Printing System.WinForms DesignComponentModel Reader/Writers.NET Compact Framework
12
.NET CLR Common Features Verifiable type safe execution No uninitialized variables, unsafe casts, bad array indexing, bad pointer math Garbage Collection No ref-counting, no leaks JIT compilation Error handling with exceptions Common type system Call, inherit, and source-level debug across different languages
13
.NET CF CLR Differences COM Interop Good support for calling native DLLs Support for calling a COM object through DLL wrappers No support for writing a COM / ActiveX object in C# or Visual Basic No install-time JIT (nGen) No remoting Client web services is fully supported No generic serialization Datasets can be serialized to XML Subsets of other areas of functionality…
14
Agenda.NET CF vs.NET Framework Major Areas Base Classes Drawing/Forms Data/XML Web Services Application Development Emulation and deployment Communication and data Security
15
Base data types are the same as the desktop Formatting StringBuilder Arrays Value types (Int16, Int32, Int64, UInt16, etc…) Floats and doubles Collections Classes for storing sets of objects Arraylists and Hashtables Basic Data Types
16
Networking Common Language Runtime.NET Compact Framework Web Services HTTP Request/Response, Network Stream Sockets Applications Sockets Synchronous and asynchronous Multiple protocols Streams Built on top of sockets Synchronous and asynchronous HTTP request and response Use stream model
17
Threading Applications start with an initial thread Applications can start new threads Using threads Responsive UI Program function segregation Thread synchronization primitives
18
Globalization Culture-correct string comparison Calendar math DateTime and numeric formatting /parsing External data Encodings.NET CF CLR is fully globalized
19
Windows Forms Support Layout Manual positioning Drawing Polygons, lines, arcs, ellipses, rectangles JPEG, BMP images Text and images TrueType bitmap fonts Most desktop controls Designer support
20
Supported Controls Button CheckBox ComboBox ContextMenu DataGrid* DomainUpDown FileOpenDialog Supported controls HScrollBar ImageList Label ListBox ListView FileSaveDialog MainMenu NumericUpDown Panel PictureBox ProgressBar RadioButton GroupBoxRichTextBox NotificationBubble Print Controls StatusBar TabControl TextBox Timer ToolBar TreeView VScrollBar Unsupported controls Unsupported controls – not available in CE CheckedListBox ColorDialog ErrorProvider HelpProvider LinkLabel NotifyIcon ToolTip Splitter FontDialog
21
Data ADO.NET DataSet Databound controls Managed providers SQL Server for Windows CE SQL Server (remote connection)
22
XML XmlTextReader and XmlTextWriter Forward-only parsers of XML data Better performance, no in-memory caching Low memory requirements XmlDocument Parse entire document In memory traversal Higher memory requirements; more functionality
23
Unsupported XML Classes XmlDataDocument Relational and hierarchical views of XML XPath Query over unstructured XML data XSLT Transform XML data to other forms XML Validation Verifies correctness of XML document
24
Web Services For Devices Web Services Synchronous and asynchronous invocation HTTP/SOAP Support calling into web services Why? Rich local UI Aggregate services Cache data locally for offline use Important considerations Bandwidth (How much? 802.11 or WWAN?) Use suitable subset of types
25
Agenda.NET CF vs.NET Framework Major Areas Base Classes Drawing/Forms Data/XML Web Services Application Development Deployment and emulation Communication and data Security
26
Application Deployment Application install uses Windows CE installer technology Visual Studio will auto-generate simple CAB files for device Installer Include application and dependant references Does not include the runtime or SQL-CE Application Install will check for the runtime when installing Temporary files are kept if user wants to customize the cab file contents
27
Framework Size Framework size (RAM or ROM) ~1.5 MB Running RAM needs 0.5 MB+ (depends on app) Typical application sizes 5 - 100 KB Apps often smaller due to use of platform features in the framework
28
Emulation Robust, accurate device emulation Runs Windows ® CE/PocketPC 2002 operating system on Windows XP Emulates localized versions of the operating system Can add images created in Platform Builder Configurable in Device Settings in Tools Options Configure RAM availability Map PC hardware to the emulator
29
.NET Framework.NET Compact Framework ActiveSync File Replication DataSet XML ADO.NET Windows Forms DataSet XML ADO.NET Service Cons Bound to single PC for data transfer No synchronization model; works best with flood synchronizing Pros Good for casually connected applications Back end agnostic Local caching for offline Active Sync Replication
30
SQL Server Windows Server ADO.NET Data Provider.NET Compact Framework ADO.NET Windows Forms Cons Must be constantly connected Not scalable on server; classic “two tier” design No synchronization model for typical dynamic data Pros Rich query into a large data source Access to entire data source; device queries for and uses what’s relevant Direct Database Access
31
Database ADO.NET ASP.NET.NET Framework.NET Compact Framework XML Web Service Cons Complex state and synchronization logic gets unwieldy Carries bulk of XML data transfer Pros Well deployed infrastructure (HTTP) Information cached; Synchronization logic on server Device communicates directly with source; no PC bridge Local Data WS Client Windows Forms Web Service Application
32
SQL CE Replication (HTTP).NET Compact Framework SQL CE ADO.NET Windows Forms SQL Server Windows Server Cons Server configuration required Engine footprint on device Pros Very robust local store Complex SQL querying Advanced/performant synchronization Utilizes HTTP SQL CE With Replication
33
Database ADO.NET ASP.NET.NET Framework.NET Compact Framework XML Web Service SQL CE WS Client Windows Forms Web Service with SQL CE Cons Carries bulk of XML data transfer Mapping of XML to SQL CE Footprint considerations Pros Well deployed infrastructure (HTTP) Information cached Structured storage Secure storage of sensitive information
34
DataSets on Devices In-memory cache of a relational database Aggregating multiple sources Reading and writing XML Remoted between tiers with XML Web Services Foundation for consistent data model from server tiers, desktop applications and now devices
35
Data Providers Providers included with.NET CF System.Data.SqlClient System.Data.SqlServerCe Custom Data Providers Follow interfaces to provide connection to custom data sources Developer creates custom code translating remote structure to DataSet
36
Security While transferring data HTTP authentication Secure sockets No encryption for System.Data.SqlClient While persisting data SQL Server CE Devices have the habit of disappearing; design for it No caching of passwords Encrypt sensitive data – SQL Server CE
37
When to choose? Windows CE.NET Supports the Win32 API Will support.NET Compact Framework Consider Win32 API when… Low-level driver code Operating system extensions Legacy code Combination will serve you well Leverage PInvoke http://msdn.microsoft.com/library/en-us/dncenet/html/choose_api.asp
38
Summary Leverage your knowledge: Build device apps! Desktop framework & tools.NET languages (C#, VB.NET) Choose the appropriate project template Compile, debug, and deploy in Visual Studio.NET 2003 Internet http://msdn.microsoft.com/vstudio/device http://gotdotnet.com/team/netcf/ msnews.microsoft.com microsoft.public.dotnet.framework.compactframework
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.