Mobile .Net
&
Mappoint Service
.NET Mobile Overview
Imran Muhammad
CS 898T
Mobile and Wireless Networks
Summer 2005
Wichita State University
Mobile Solution Scenarios








Mobile Office: Email, PIM, IM etc
SFA (Sales Force Automation): Mobile CRM, Order
Entry etc
Delivery Automation : Route Drivers, Taxis etc
FFA (Field Force Automation): Service
Technicians, Installers etc
Warehouse Automation : Inventory Control etc
Asset Tracking : Asset Mgmt, Bag Tracking etc
Mobile Government : Inspections, Law
Enforcement, Activity Reporting etc
Consumer : Games, Find Services etc
Windows Mobile Device Options
Pocket PC Phone Edition
Smartphone
Usage

Data first, with phone functionality

Phone first with data functionality
Target Market

Consumer and LOB

Consumer and Mobile Professional
Form Factor

Larger 240x320

176x220 hi-res color screen
Input



Two-handed use
Touch screen and stylus

One-handed navigation
Keypad and joystick
Applications

Full application suite

No Microsoft Portrait
Key Scenarios



Mobile Outlook
LOB Applications

Mobile Outlook
Consumer Applications

.NET CF and eVC

eVC and .NET CF 2.0
Embedded
Development
Mobile Application
Development
The Application Universe
Tools
XML Web Services
Authentication
Enterprise Databases
Location Services
CRM
Email
Billing
Voice Calls
Data Calls
etc…
User Experiences & Solutions
Clients
.NET Framework Architecture
VB
C++
C#
J#
…
Common Language Specification
ASP.NET
Windows Forms
ADO.NET and XML
Base Class Library
Common Language Runtime
Windows
COM+ Services
What is the
.NET Mobile
Framework ?
.NET Device Programming
Two approaches – one model, one tool
ASP.NET Mobile
Controls
Smart Device
Programmability
Remote Web Pages
Local Code
Mobile Web
Browser
.NET Compact
Framework
Device Operating System
.NET Device Programming
Smart Device Programmability
ASP.NET Mobile
Controls
Smart Device
Programmability
Remote Web Pages
Local Code
Mobile Web
Browser
Smart client
Smart Devices
.NET Compact
Framework
Device Operating System
.NET CF Design Goals

Compatibility



Strict compatibility with .NET Framework
Subset functionality
Subset for devices



Give the developer
a known target
Enable skills and
code transfer
Size/functionality
.NET Framework
.NET Compact
Framework
.NET Mobile 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
Tunable size and performance
Desktop .NET Framework
System.Web
Services
Description
UI
HtmlControls
Discovery
WebControls
System.WinForms
Design
ComponentModel
System.Drawing
Protocols
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
ADO.NET
System.Xml
SqlClient
Design
XmlDocument
Serialization
Xslt/XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
.NET Compact Framework
System.Web
Services
Description
UI
HtmlControls
Discovery
WebControls
System.WinForms
Design
ComponentModel
System.Drawing
Protocols
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
ADO.NET
SqlClient
XmlDocument
Serialization
Design
SqlServerCe
Xslt/XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework Size

Framework size (RAM or ROM)


Running RAM needs


~1.5 MB
1 MB+ (depends on app)
Typical application sizes


50 - 500 KB
Apps often smaller due to use of platform
features in the framework
What’s going on
.NET CLR Common Features

Verifiable type safe execution


Garbage Collection




No uninitialized variables, unsafe casts, bad
array indexing, bad pointer math
ref-counting, reduced leaks
JIT compilation
Error handling with exceptions
Common type system

Call, inherit, and source-level debug across
different languages
Compact CLR Differences

Limited COM Interop






No Install-time JIT (nGen)
No Reflection Emit
No Remoting


Client web services is fully supported
No Generic Serialization


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
Datasets can be serialized to XML
Subsets of other areas of functionality
Features not supported in
.Net Mobile Framework




ASP .Net: Primarily being a rich client
platform, it doesn’t provide any ASP .Net
support.
Assemblies and GAC: There is no support
for multimodule assemblies.
COM Interoperability: Even though
interoperability with COM objects is not
supported, there are other ways of
accessing a COM object. Platform Invoke
method can be used to call native DLLs
which in turn can access COM DLLs.
Asynchronous Delegates: Not supported.






Reflection: No support for
System.Reflection.Emit namespace.
XML Web Services: Developers cannot
host web services under .Net Mobile
Framework.
Remoting: Cannot develop Remoting
applications.
Printing: No support for printing
functionalities.
GDI+: Advance GDI support is missing in
Compact Framework.
XML: XML Schema validations and XPath
are not supported.
The Development
Environment
Supported Controls

Supported controls
Button
CheckBox
ComboBox
ContextMenu
DataGrid
DomainUpDown
FileOpenDialog

MainMenu
NumericUpDown
Panel
PictureBox
ProgressBar
RadioButton
StatusBar
TabControl
TextBox
Timer
ToolBar
TreeView
VScrollBar
Unsupported controls
GroupBox

HScrollBar
ImageList
Label
ListBox
ListView
FileSaveDialog
RichTextBox
NotificationBubble
Print Controls
Unsupported controls – not available in CE
CheckedListBox
ColorDialog
ErrorProvider
HelpProvider
LinkLabel
NotifyIcon
ToolTip
Splitter
FontDialog
Working with
resolution and
rotation …
Fit Content to Window
Portrait
Landscape
Change the Content

Content may need to change when orientation changes
Portrait
Landscape
Change the Layout
Portrait
Landscape
Design for Square
Portrait
Landscape
Networking

Sockets



Streams



Synchronous and asynchronous
Multiple protocols
Built on top
of sockets
Synchronous
and asynchronous
HTTP request
and response


Use stream model
Requires no user
knowledge of HTTP
Applications
.NET Compact Framework
Web Services
HTTP Request/Response, Network Stream
Sockets
Common Language Runtime
Data Characteristics

Amount of data to be stored



<100 kb: XML
> SQL Server CE
Amount of data to be exchanged


< 1MB web services
 Small chunks more frequently
> Remote data access or merge replication
 Larger chunks less frequently
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
ADO.NET Support





Handling data offline with DataSet
Communicating DataSet with XML
Common data model from server to PC to
device
Extensible ADO.NET provider model
Included data providers


SQL Server (System.Data.SqlClient)
SQL Server CE (System.Data.SqlServerCe)
Web Services Support






Calling XML Web Services
Synchronous and asynchronous
invocation
Basic and Digest authentication
Secure Sockets Layer support for
encryption (SSL)
Custom SOAP headers
SOAP Extension Framework
Data Access in .NET Mobile

Active Data Object (ADO) .NET

SQL Server CE
• Caching
• Synch

Internet
Information
Server (IIS)
SQL Server
Disconnected mode support

Internet

Mobile applications can access
Microsoft SQL Server 2000 on
remote servers or access a SQL
Server CE locally on the device
SQL Server CE lets applications
cache large volumes of data (tens
of megabytes), read, and update in
disconnected mode
SQL Server CE provides
synchronization mechanisms for
changes made upon
reconnection
SQLCE

SQL Server CE




Supports large datasets, rich queries,
transactions
Small footprint, DBMS can live on memory
card
Some limitations (no stored procedures,
triggers)
Synchronization through:
 Replication (RDA or Merge)
 XML Web Service Synchronization
Demonstration : .Net & services
5
3
Google
WebService
3
FedEx
WebService
3
MapPoint
WebService
Service SQL
MapPoint Web Service

Microsoft MapPoint Web Service is an
XML Web service with a SOAP API that
allows you to add location-based
functionality to your application that calls
on the high-quality maps, as well as the
location-finding and routing capabilities
of MapPoint Web Service. MapPoint Web
Service is comprised of four constituent
services: Common, Find, Render, and
Route.
Introduction to the MapPoint Web
Services

Web Services providing location-based services





Maps
Driving Directions
Proximity Searches
Current Version 3.5
Can integrate your own, custom, data with the
data provided


Store locations
Custom Icons
MapPoint Web Service 3.5


Enriches your application by making
mapping a simple “ingredient”
.NET Web Service API




Find, Render, Route services
Developed and hosted by Microsoft
20M+ transactions per day
Extensive Geographic Data


Coverage in 38 countries worldwide
More than 15 million Points of Interest
Web Service API

Staging WSDL File at

Production environment also available
Sign up for Eval Account

http://staging.mappoint.net/standard-30/mappoint.wsdl


http://msdn.microsoft.com/mappoint
MSDN Subscribers get 12 months or 50,000 hits
Web Service API





Common Service
Find Service
Render Service
Route Service
Customer Data Service
Web Service API

Common Service


utility classes, methods and properties that
are common to the find, route, and render
services, or are basic utility functions used by
the other services
Address class contains the constituent parts
of an address: street, city, other city, region,
country, and postal code.
Web Service API

Find Service






Locate addresses and points of interest
Get information about specific Lat/Long
Find locations near a specific point or along a
route
Find addresses and geographic entities
Find POI spatially or along routes
Parse addresses
Find Service

The Find service allows you to locate
addresses, geographic entities, latitude
and longitude coordinates, and points of
interest from MapPoint Web Service data,
as well as parse addresses and return
location information for a specified
latitude and longitude coordinate.
 FindServiceSoap class contains the methods and properties related to calling the Find service.
 FindAddress method returns a list of found addresses based on an input address,
in order of how well the results match the search criteria.
 FindAddressSpecification class contains the search specification used in the
 FindServiceSoap.FindAddress method. Specifies the address to find, the search options to use, and
the data source from which to get results.
Web Service API (cont)

Render Service






Render maps showing routes and locations
Set map size, view and controls
Add pushpins (including custom icons)
Select points on a map, get location
information about points on a map, pan and
zoom a rendered map, and create clickable
maps.
30 map styles available
4 designed specifically for devices
Render Service
RenderServiceSoap class contains the methods and properties related to calling the Render service.
MapSpecification class contains the specifications for rendering a map. Includes the data source to use,
map views, pushpins, route, selected entities, and map options.
GetMap method returns map images, map views, and hot area definitions based on map options.
GetBestMapView method returns the best map view for a selected location or set of locations. The best
map view is the largest scale map that contains all the desired locations.
MapOptions class contains the map rendering options used in the RenderServiceSoap.GetMap method.
Specifies the the data source, the image format, panning and zooming factors, and identification of the
requested map as an overview map.
Pushpin class contains the icon, label, location, and user-defined identification number of a pushpin.
A Pushpin object is used to mark a location on a map image, and the location can be a place, address, or
latitude and longitude coordinate.
Render Service
MapView class is an abstract class representing a requested map view. Each of the derived classes defines
A map view using a different measure: a set of location points, a bounding rectangle, height and width, or
scale.
MapImage class contains a map returned from the RenderServiceSoap.GetMap method. Includes the image
or a URL to get the image, map view representations, and the hot areas associated with pushpins.
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = “MapPoint.AP”;
mapSpec.Options… desired size and style
mapSpec.Views = my MapViewRepresentation object
MapImage[ ] maps = RenderService.GetMap(mapSpec);
Image mapImage =
new Bitmap(MemoryStream(maps[0].MimeData.Bits)); Render Service
Web Service API

Route Service




Generate driving directions and routes
including setting waypoints
Calculates routes and itinerary
Shortest or Quickest route options
Use CalculateSimpleRoute for LatLong point
based routes
Route Service
RouteServiceSoap class contains the methods and properties related to calling the Route service.
Route class contains a route of two waypoints (start and end points). A Route can include a specification, a set o
CalculateSimpleRoute method returns a route based on specified latitude and longitude coordinates.
Getting MapPoint
Route myRoute = RouteService.CalculateSimpleRoute(
LatLong[],
"MapPoint.AP",
SegmentPreference.Quickest);
Segment tripSegment = myRoute.Itinerary.Segments[0];
foreach (Direction step tripSegment.Directions)
Console.WriteLine(step.Instruction);
Route Service
Directions
km
Start
Depart 1 Epping Rd, North Ryde, NSW 2113 on Epping Rd (West)
0.6
1
Turn LEFT (North) onto M2 [M2 Motorway]
3.9
2
*Toll road* Stay on M2 [M2 Motorway] (North)
0.1
3
Stay on M2 [M2 Motorway] (North-West)
6.6
4
Turn LEFT (South) onto 7 [Cumberland Hwy]
6.6
5
Turn RIGHT (North) onto Ramp [Cumberland Highway Exit]
0.2
6
Bear LEFT (North-West) onto 7 [Cumberland Hwy]
1.2
7
Road name changes to Cumberland Hwy [James Ruse Dr]
0.2
8
Road name changes to 7 [Cumberland Hwy]
1.8
9
Turn LEFT to stay on 7 [Cumberland Hwy]
0.5
10
…
Web Service API

Customer Data API

Programmatic upload of custom data
Resources

http://msdn.microsoft.com/mobility
http://www.microsoft.com/mobile
http://microsoft.public.dotnet.framework.compactfr
amework.com
http://microsoft.public.smartphone.developer.com
http://microsoft.public.pocketpc.developer.com
http://www.microsoft.com/mappoint/webservice/d
efault.msp
http://msdn.microsoft.com/mappoint

http://blogs.msdn.com/cthota/






Q&A
Thank you…
Imran Muhammad
[email protected]
Descargar

.NET Compact Framework Overview