+ All Categories
Home > Documents > Beginning Compact Framework

Beginning Compact Framework

Date post: 19-Feb-2016
Category:
Upload: bianca
View: 52 times
Download: 1 times
Share this document with a friend
Description:
Beginning Compact Framework. Mohammad Faridi (faridianslip) Umer Faruq. Agenda. Introduction to Compact Framework Compact Framework Smart Device Extensions Data Access Design Considerations Upgrading. Introduction to Compact Framework. Introduction to CF.NET. Evolution of PDA - PowerPoint PPT Presentation
Popular Tags:
54
June 2003 Beginning Compact Framework Mohammad Faridi (faridianslip) Umer Faruq
Transcript
Page 1: Beginning Compact Framework

June 2003

Beginning Compact Framework

Mohammad Faridi (faridianslip)Umer Faruq

Page 2: Beginning Compact Framework

Agenda Introduction to Compact Framework Compact Framework Smart Device Extensions Data Access Design Considerations Upgrading

Page 3: Beginning Compact Framework

June 2003

Introduction to Compact Framework

Page 4: Beginning Compact Framework

Introduction to CF.NET Evolution of PDA

– PDA (Personal Digital Assistant) – Windows CE 1996– PocketPC 2002 (Current Version)

– Previous Development :Environment: Embedded ToolkitLanguages: VB, VC++

Page 5: Beginning Compact Framework

Introduction to CF.NET

eVC– Native Code– Targets SmartPhone– Drivers for the Pocket PC/CE– Applications run natively– Games using high-speed graphics– COM Servers or ActiveX Controls

Page 6: Beginning Compact Framework

Introduction to CF.NET

eVB– Resulting pcode is interpreted at runtime– Based on VB Scripting rather than VB– Build Enterprise Apps that consist mainly of

ActiveX and COM Controls– RAD prototypes– Create Utilities

Page 7: Beginning Compact Framework

Introduction to CF.NET

What is Compact Framework ?– A subset of the .NET Framework designed to

run on devices with limited capabilities (Window CE) but without targeting specific hardware

Page 8: Beginning Compact Framework

Introduction to CF.NET

Compact Framework– Managed Code– Write once, deploy to multiple devices– OOP– XML Web Services– ADO.NET– Apps that work Connected or Disconnected– VB.NET or C#

Page 9: Beginning Compact Framework

eMbedded Visual C 3.0

eMbedded Visual Basic 3.0

eMbedded Visual C 4.0

SDE

Native Code

X X

Managed Code

X (Not based on .NET)

X

Pocket PC or Pocket PC 2002

X X X

Smartphone 2002

X

Embedded Devices

X X X X

COM Development

X X (Cannot create ActiveX)

X

Driver Development

X X

Debug Drivers

X X

Page 10: Beginning Compact Framework

June 2003

Compact Framework

Page 11: Beginning Compact Framework

CF.NET and .NET Framework

Infrastructure Servers

Tools XML Web

Services

Clients

User Experiences & Solutions

Authentication SMSVoice CallsSubscriber DBMMS Data CallsPersonalization Billingetc…

Page 12: Beginning Compact Framework

A large number of devices…

Page 13: Beginning Compact Framework

Making Applications Truly 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

Page 14: Beginning Compact Framework

CF.NET 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 .NET Compact FrameworkFramework

Page 15: Beginning Compact Framework

CF.NET Design Goals Portable and small .NET CLR for devices

– Enable Visual Basic® and C# Leverage Visual Studio® .NET

– Run managed .EXEs and .DLLs directly– Debug with Visual Studio .NET

Enable rich client Web Services and line of business applications on devices– Class libraries for forms, drawing, storage, net, data, XML

Peacefully co-exist with host OS– Run on native threads, P/Invoke to call native code

Page 16: Beginning Compact Framework

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

Page 17: Beginning Compact Framework

.NET Framework Components

SystemSystem

System.DataSystem.Data System.XmlSystem.Xml

System.WebSystem.Web

GlobalizationGlobalizationTextTextSecuritySecurityCollectionsCollections

ResourcesResourcesReflectionReflectionNetNetIOIO

ThreadingThreadingDiagnosticsDiagnosticsServiceProcessServiceProcessConfigurationConfiguration

DesignDesignADO.NETADO.NET SqlClientSqlClient

Xslt/XPathXslt/XPathXmlDocumentXmlDocument

RuntimeRuntimeInteropServicesInteropServicesRemotingRemotingSerializationSerialization

SerializationSerialization

ConfigurationConfiguration SessionStateSessionStateCachingCaching SecuritySecurity

ServicesServicesDescriptionDescriptionDiscoveryDiscoveryProtocolsProtocols

UIUIHtmlControlsHtmlControlsWebControlsWebControls

System.DrawingSystem.Drawing

ImagingImagingDrawing2DDrawing2D

TextTextPrintingPrinting

System.WinFormsSystem.WinFormsDesignDesign ComponentModelComponentModel

Reader/WritersReader/Writers

Page 18: Beginning Compact Framework

CF.NET Framework Components

System

System.Data System.Xml

System.Web

GlobalizationTextSecurityCollections

ResourcesReflectionNetIO

ThreadingDiagnosticsServiceProcessConfiguration

DesignADO.NET

SqlServerCeSqlClient

Xslt/XPathXmlDocument

RuntimeInteropServicesRemotingSerialization

Serialization

Configuration SessionStateCaching Security

ServicesDescriptionDiscoveryProtocols

UIHtmlControlsWebControls

System.Drawing

ImagingDrawing2D

TextPrinting

System.WinFormsDesign ComponentModel

Reader/Writers

Page 19: Beginning Compact Framework

Common CLR Features Compact Framework supports all the core CLR

features– Exceptions– Constructors and Finalizers

IDisposable– Remote Debugging– App Domains

Applications can start another application domain in-process

– P/Invoke

Page 20: Beginning Compact Framework

Common CLR Features not included Reflection Emit Remoting Serialization Printing COM Interoperability Server side functionality XPath/XSLT

Page 21: Beginning Compact Framework

June 2003

Smart Devices Extension

Page 22: Beginning Compact Framework

Local CodeRemote Web Pages

Visual Studio .NET

.NET Framework

Mobile Web Browser

.NET CompactFramework

Client-sideRich Apps

Server-side Web Apps

Smart Device Extensions and MITDevelopment Platform Overview

Page 23: Beginning Compact Framework

Visual Studio .NET

.NET Framework

Mobile Web Browser

.NET CompactFramework

Local CodeRemote Web Pages

MIT (Mobile Internet Toolkit)

Page 24: Beginning Compact Framework

SOAP

XML Web Services

Common Language Runtime (CLR)

Base FrameworkData and XML

Web Services User InterfaceASP.NET, Mobile Internet Toolkit

VB C++ C# Perl Python …

Visual Studio .NET

Windows

Mobile Web Pages

Mobile Web Browser

Device OS

MIT (Mobile Internet Toolkit)

Page 25: Beginning Compact Framework

Visual Studio .NET

.NET Framework

Mobile Web Browser

.NET CompactFramework

Local CodeRemote Web Pages

SDE (Smart Devices Extension)

Page 26: Beginning Compact Framework

Local Code

SOAP

XML Web Services

Visual Studio .NET

.NET Compact Framework

Windows

.NET CompactFramework

Device OS

Smart Device Extensions

SDE (Smart Devices Extension)

Page 27: Beginning Compact Framework

SDE versus MIT

MIT– Advantage

Support a broad range of devices

Browser access MIT handles the device

differences– Disadvantage

Doesn’t work offline No local processing

power Limited user interface

SDE– Advantage

The best way to do online and offline

Takes full advantage of Pocket PC

Excellent integration with SQL Server™ CE

Powerful local processing and rich graphics, multimedia

– Disadvantage Limited device support

Page 28: Beginning Compact Framework

SDE: Intro to the CF environment

Use Windows Forms Designer

Drag-and-drop, property-based

Rich subset of desktop controls

– User Interface controls Data Entry Display

– Formatting & RAD controls Organizational controls Helper controls

Page 29: Beginning Compact Framework

SDE Controls: A Subset of Desktop Controls

Data Entry Check Box Combo Box Command Button Domain Up/Down List Box Numeric Up/Down Radio Button Text Box Track Bar

Display Label Picture Box Progress Bar Status Bar

Helper Context Menu Scroll Bars Image List Main Menu Open & Save File

Dialogs Timer Tool Bar

Organizational List View Panel Tab Control

Controls Not Supported Checked List Box DateTime Picker

Group Box Month Calendar

Splitter

Page 30: Beginning Compact Framework

SDE: 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

Page 31: Beginning Compact Framework

SDE: 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

Page 32: Beginning Compact Framework

SDE: 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

Page 33: Beginning Compact Framework

June 2003

Data Access

Page 34: Beginning Compact Framework

Data Access: Included 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

Page 35: Beginning Compact Framework

Data Access: ADO.NETDataSet

DataAdapter

DataReader

Command

DataParameter

Connection

Transaction

Opens ‘pipeline’ to data source

Configures commands sent to source

Used for parameterized commands

Configures transactions on connection

Serializes to and from DataSet

Forward-only reader with typing

Disconnected cache object

Page 36: Beginning Compact Framework

Data Access: Direct DB Access

SQL ServerSQL Server

Windows Windows ServerServer

ADO.NETADO.NETData ProviderData Provider

.NET Compact .NET Compact FrameworkFramework

ADO.NETADO.NET

WindowsWindowsFormsForms

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

Page 37: Beginning Compact Framework

Data Access: SQLCE

SQL CESQL CEReplication Replication

(HTTP)(HTTP).NET Compact .NET Compact FrameworkFramework

SQL CESQL CE

ADO.NETADO.NET

WindowsWindowsFormsForms

SQL ServerSQL Server

Windows Windows ServerServer

Cons– Server configuration

required– Engine footprint on

device

Pros– Very robust local store– Complex SQL querying– Advanced/performant

synchronization– Utilizes HTTP

Page 38: Beginning Compact Framework

Data Access: DataSets 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

Page 39: Beginning Compact Framework

Supported XML Classes 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

Page 40: Beginning Compact Framework

June 2003

Design Considerations

Page 41: Beginning Compact Framework

Design Considerations

Key Factors to keep in mind: Simplicity Consistency User Control Feedback Accessibility Aesthetics

Page 42: Beginning Compact Framework

Design Considerations: Simplicity Show the most frequently used controls directly on

the interface Hide secondary controls in menus Automate as many processes as you can Show only relevant data Group related tasks Allow users to navigate to data by selecting options Reduce the amount of data entry users must perform Reduce number of steps needed to complete a task

Page 43: Beginning Compact Framework

Design Considerations: Consistency Reuse existing user interface concepts and

design guidelines. Use controls, such as scroll bars, that behave

similarly regardless of context. Extend existing concepts to cover new

situations. Design a new control or concept if you cannot

extend your solution.

Page 44: Beginning Compact Framework

Design Considerations: User Control Allow users to complete tasks in fewer steps. Provide ways for users to customize your

application. Give users the opportunity to reverse or

continue their actions despite non-critical errors.

Page 45: Beginning Compact Framework

Design Considerations: Feedback Users need and should receive clear and

immediate feedback on their actions. Such feedback can enhance the presentation of written and graphical information.

Two types of Feedback are:– Visual Feedback achieved through:

Messages Animation

– Audio Feedback achieved through: A piece of music or voice message. Alert messages.

Page 46: Beginning Compact Framework

Design Considerations: Accessibility To improve accessibility, give higher priority to

these factors:– Tasks that affect large numbers of users– Frequently performed tasks– Accommodate a wide variety of user needs– Make your application predictable and consistent– Screen enlargers and screen magnifiers – On-screen keyboards that use a pointing device or a

switch

Page 47: Beginning Compact Framework

Design Considerations: Aesthetics Select interface elements carefully Create a tidy appearance Establish a design strategy and style convention

before you begin development Respect user settings and preferences Select the fewest elements needed to

communicate information

Page 48: Beginning Compact Framework

June 2003

Upgrading

Page 49: Beginning Compact Framework

Upgrading eVB to VB.NET

No Implicit Late Binding– E.g., No Variants, No CreateObject()

Forms object model different– Windows.Forms vs. eVB 3.0 Forms

ADOCE superceded by ADO.NET– Programming models differ significantly

No ActiveX controls/components

Page 50: Beginning Compact Framework

Upgrading Porting Advice

Will port:– Core business logic

Rewrite:– Data Access code (ADO -> ADO.NET)– Forms (eVB 3.0 -> Windows.Forms)– COM component access

Page 51: Beginning Compact Framework

Upgrading

New applications? VS.NET Existing applications?

– In maintenance mode? Keep as eVB 3.0– Adding significant features? VB.NET

Page 52: Beginning Compact Framework

Agenda Introduction to Compact Framework Compact Framework Smart Device Extensions Data Access Design Considerations Upgrading

Page 53: Beginning Compact Framework

June 2003

Demos

Page 54: Beginning Compact Framework

June 2003

Questions?


Recommended