uThe .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet
.NET Framework in context
.NET Framework Architecture
Mobile Application Development
Windows Mobile Device
Definition: Mobile Solution
uMobile solutions are defined as any application that enables seamless computing to enterprise applications and data regardless of the type, quality and duration of network connectivity.
Design Goals
uTarget mobile and embedded devices
uPortable subset of .NET Framework
vNo new ‘compact’ namespaces
vVisual Basic .NET and C# compiler support in v1
uLeverage Visual Studio .NET
vRun managed .EXEs and .DLLs directly
vDebug with Visual Studio .NET
uPeacefully co-exist with host OS
vRun on native threads, P/Invoke to call native code
What is the .NET Compact Framework?
.NET Compact Framework
uLightweight version of .NET Framework
uDesigned for resource-constrained devices
uCompatible with VS.NET, C#, VB.NET
uRuns applications securely on-device
vHigh performance JIT compiler
vGuarantees robustness and security
vHighly interactive, offline, and networked experiences
vMakes it easy to consume web services
uTunable size and performance
.NET Device Programming Two approaches – one model, one tool
vApps often smaller due to use of platform features in the framework
.NET Compact Framework platform architecture
.NET CLR Common Features
uVerifiable type safe execution
vNo uninitialized variables, unsafe casts, bad array indexing, bad pointer math
uGarbage Collection
vNo ref-counting, no leaks
uJIT compilation
uError handling with exceptions
uCommon type system
vCall, inherit, and source-level debug across different languages
Compact CLR Differences
uCOM Interop
vGood support for calling native DLLs
vSupport for calling a COM object through DLL wrappers
vNo support for writing a COM / ActiveX object in C# or Visual Basic
uNo Install-time JIT (nGen)
uNo Reflection Emit
uNo Remoting
vClient web services is fully supported
uNo Generic Serialization
vDatasets can be serialized to XML
uSubsets of other areas of functionality
The Development Environment
Creating A Device Project In Visual Studio
uSmart Device project type in the New Project dialog
uSelect device platform and project type with the New Project Application Wizard
uNew project has a default set of references that are appropriate for your platform
uEnvironment adapts to the new platform by inspecting references
Writing Your Application
uToolbox has the device controls with the proper properties and events
vDevice look and feel at design time
uIntelliSense™ targets the .NET Compact Framework and project references
uEditor underlines (squiggles) classes and methods that are not available
uWeb services and Web references fully supported
vAuto-generated proxy
uAdditional project properties for device projects
Running Your Application
uRunning your application will automatically copy it to the device
uVisual Studio installs the .NET Compact Framework on the device
uSelect the deployment device from the device toolbar or project properties
uEmulator will automatically start if needed
Emulation
uRobust, accurate device emulation
uRuns Windows® CE operating system on Windows XP
uEmulates localized versions of the operating system
uCan add images created in Platform Builder
uConfigurable in Device Settings in Tools Options
vConfigure RAM availability
vMap PC hardware to the emulator
Debugging
uSupported features include
vOn-device debugging from Visual Studio Shell
vLine and Data Breakpoints
vMulti-language debugging
vCall Stack, Watch windows
vCommand window – Immediate
uFeatures Not Supported
vNo set next statement
vNo native<->managed unified debugging
vNo attach to process
Debugging
Application Deployment
uApplication install uses Windows CE installer technology
uVisual Studio will auto-generate simple CAB files for device Installer
vInclude application and dependant references
vDoes not include the runtime or SQL-CE
uApplication Install will check for the runtime when installing
uTemporary files are kept if user wants to customize the cab file contents
Windows Forms Support
uLayout
vManual positioning
uDrawing
vPolygons, lines, arcs, ellipses, rectangles
vJPEG, BMP images
uText and images
vTrueType bitmap fonts on Mobile
uMost desktop controls
uDesigner support
Supported Controls
Button
CheckBox
ComboBox
ContextMenu
DataGrid
DomainUpDown
FileOpenDialog
uSupported controls
Major areas of .NET CF
uBase Classes
uDrawing/Forms
uData/XML
uXML Web Service Client
Basic Data Types
uBase data types are the same as the desktop
vFormatting
vStringBuilder
vMore efficient when string length changes
vArrays
vValue types (Int16, Int32, Int64, UInt16, etc…)
vFloats and doubles
uCollections
vClasses for storing sets of objects
vArraylists and Hashtables
Base: Networking
uSockets
vSynchronous and asynchronous
vMultiple protocols
uStreams
vBuilt on top of sockets
vSynchronous and asynchronous
uHTTP request and response
vUse stream model
vRequires no user knowledge of HTTP
Base: Threading
uApplications start with an initial thread
uApplications can start new threads
uUsing threads
vResponsive UI
vProgram function segregation
uThread synchronization primitives
uApp domains exist until all threads exit
Base: Native Code InterOp
uManaged à native (P/Invoke)
vCalls into existing native code
v.NET Compact Framework does “flat” marshalling of arguments
vCalling COM objects in process
uNative à managed
vP/Invoke and block
Base: Globalization
uCulture-correct String comparison
uCalendar math
uDateTime and numeric formatting and parsing
uExternal data
vEncodings
u.NET Compact Framework CLR is fully globalized
vData tables are factored
vCan use Windows CE tables
XML
uXmlTextReader and XmlTextWriter
vForward-only parsers of XML data
vBetter performance, no in-memory caching
vLow memory requirements
uXmlDocument
vParse entire document
vIn memory traversal
vHigher memory requirements; more functionality
Unsupported XML Classes
uXmlDataDocument
vRelational and hierarchical views of XML
uXPath
vQuery over unstructured XML data
uXSL/T
vTransform XML data to other forms
uXML Validation
vVerifies correctness of XML document
ADO.NET Support
uHandling data offline with DataSet
uCommunicating DataSet with XML
uCommon data model from server to PC to device
uExtensible ADO.NET provider model
uIncluded data providers
vSQL Server (System.Data.SqlClient)
vSQL Server CE (System.Data.SqlServerCe)
Web Services Support
uCalling XML Web Services
uAll encoding types
uSynchronous and asynchronous invocation
uBasic and Digest authentication
uSecure Sockets Layer support for encryption (SSL)
uCustom SOAP headers
uSOAP Extension Framework
uHighly Reuse
Application Deployment
Why Not Do An “eVB 4.0”?
ueVB was adequate for quickly building simple applications, but fell short for larger, more complex applications.The next generation of highly network oriented applications will demand even more functionality and new paradigms.
VB .NET Desktop Differences
uVery rich subset, but some limitations
vNo Implicit Late Binding
ve.g. Dim x as Object : x.CallFoo()
vNo legacy VB style file i/o support
vUse full .NET file i/o
vNo hosting ActiveX controls in forms
vNo creating ActiveX controls in Visual Basic
VB .NET and C# Native Code Inter-Op
uManaged app can use native code (PInvoke)
vSame syntax as the desktop
vExposes rich Windows CE APIs
vAutomatically marshals simple data types
vHigh performance, low overhead transitions
uNo automatic “COM Inter-Op”
vCreate a managed class to wrap the object and native code to call object
uCannot expose managed code to native code
uSome attributes not supported
Compatibility and Performance
uCompatible with full .NET Framework
vInteroperability, protocols
uCompatible with .NET CF 1.0
vSide-by-side execution
vApplication compatibility
uEnhanced performance
vUnified JIT
vImproved string handling
vXML improvements
vImproved ADO.NET with SQL Mobile
Displays and Layout
uOrientation support
vDocking and anchoring
vAutoScroll property – forms, panels
vSuspendLayout and ResumeLayout
vChangeOrientation – portrait or landscape
uResolution support
vAutomatic scaling
vGraphics
vDpiX
vDpiY
uData access
vSQL Mobile
vDataGridView
uTextbox IME switching
vInputModeEditor
uEnable multiple menu items on left softkey
uEnhanced VB.NET features
v"My" namespace support
uEnhanced C# features
vIterators
vAnonymous methods
uCross language features
vGenerics
vPartial classes
New Windows Forms Controls
uDateTimePicker
uMonthCalendar
uDocumentList
uLinkLabel
uNotification
uHelp
uWebBrowser
Windows Forms Features
uClipboard support
uAdditional properties, methods and events
vControl.DoubleClick
vToolBarButton tooltips
vMore Treeview events
uKeyboard support
vForm.KeyPreview
vTabIndex, TabStop
System.Xml Namespace
uImproved performance
uSchema validation support
vNo DTD Support
uStatic creation methods for XmlTextReader and XmlTextWriter
uXML processing through XPath
uXmlSerialization
System.Messaging Namespace
uSupport for message queuing
vSend and receive messages
vInter-application communication without a live connection
vCommunication using unreliable connections
vAdminister, connect, and monitor network message queues
Future Windows Mobile Platform
Windows Mobile Roadmap
Visual Studio 2005
uEnhanced project wizard
vTarget Pocket PC or Smartphone
uEnhanced designers
uEmulator support
vBased on ARM processor
vSave multiple states
uCAB and Setup projects
uIntegrated device and emulator debugging
uRemote tools
vProcess viewer, file viewer, heap walker, and more…
Emulators
uBuild and test applications without a device
vRequires a network connection or loopback adapter
uSmart device applications use a variety of Windows Mobile based emulators
uVisual Studio 2005 automates debugging and deployment
Native Language Support
uFirst-class native C++ support
vMFC 8.0
vATL 8.0
uOne IDE for developing both Managed and Native components of an application
vDebug mixed Native/Managed application at the same time