32

Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

  • Upload
    ukdpe

  • View
    937

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP
Page 2: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Mike Taulty Microsoft UK [email protected] mtaulty.com @mtaulty

Silverlight development for Windows Phone 7 CTP

Page 3: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight is...?

2007

2008

2009 2010

1: a media player

2: .NET subset for RIA

3: out of browser

4: line of business

Page 4: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight is...?

a development platform for Windows Phone 7 2007

2008

2009 2010

1: a media player

2: .NET subset for RIA

3: out of browser

4: line of business

Page 5: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight development on the desktop

C#

Visual Basic

XAML

XAP

XAP

Manifest Assembly Resource

Silverlight Fx/CLR

Page 6: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight development on Windows Phone 7

C#

Visual Basic

XAML

XAP

Manifest Assembly Resource

.NET Compact Framework/CLR

Windows Phone

Marketplace

Page 7: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo “Hello World” on the phone

Page 8: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight functionality on Windows Phone 7

a super-subsetTM of Silverlight 3

Page 9: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight 3 functionality on the desktop

UI Capabilities

Controls Media Graphics

Composition, Layout, Styling, Resources, Animation, Data Binding, Transformations, Effects

Network

• HTTP(S)

• WCF HTTP(S)

• WCF Data Services

• Sockets

Browser

• HTML Interop

• Javascript Interop

• SL SL Local Messaging

File System

• File Access

• Isolated Storage

Page 10: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Core Assemblies

Silverlight 3 functionality on the desktop

SDK Assemblies

LINQ to XML

Data Annotations

JSON

Controls

• DataGrid

• DescriptionViewer

• Label

• ValidationSummary

• Calendar

• DatePicker

• GridSplitter

• TabControl

• TreeView

• AutoCompleteBox

• PagedCollectionView

WCF

• Data Services

• PollingDuplex

• Syndication

Visual Basic

XML

Browser Interop

WCF ServiceModel

Serialization

Networking

Core UI

•Controls

•Media

•Shapes

•etc

Core Framework

•Collections

• IO

•Diagnostics

•Reflection

•Threading

•etc. XML Serialization

Page 11: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Core Assemblies

Silverlight 3 functionality in the Phone CTP

SDK Assemblies

Controls

• DataGrid

• DescriptionViewer

• Label

• ValidationSummary

• Calendar

• DatePicker

• GridSplitter

• TabControl

• TreeView

• AutoCompleteBox

• PagedCollectionView

WCF

• Data Services

• PollingDuplex

• Syndication

XML

WCF ServiceModel

Serialization

Networking

Core UI

•Controls

•Media

•Shapes

•etc

Core Framework

•Collections

• IO

•Diagnostics

•Reflection

•Threading

•etc.

Browser Interop

Visual Basic

Data Annotations

JSON

LINQ to XML

XML Serialization

Page 12: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

Silverlight 3 functionality in the Phone CTP

UI Capabilities Network

• HTTP(S)

• WCF HTTP(S)

File System

• Isolated Storage

Graphics Media Controls

Composition, Layout, Styling, Resources, Animation, Data Binding, Transformations, Effects

Phone Specific

Functionality

Page 13: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

about the phone...

Page 14: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

application structure – navigation applications

RootVisual

UserControl

Content

Frame

Page

desktop Silverlight

RootVisual

PhoneApplicationFrame

PhoneApplicationPage

phone Silverlight

Page 15: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

application lifecycle Not

Running

Startup

Running

Exit

Obscured

Paused

Shell Notification Switch Apps

app may be terminated

Page 16: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

controls and themes

standard Silverlight controls re-themed

support for dynamic theming based on user settings

wide margin for ease of touch

Page 17: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo navigation & control theming

Page 18: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

physical information about the phone

screen resolution?

where is the phone?

is the phone moving?

can I alert the user?

screen orientation?

Page 19: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

where is the phone?

GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Low); // saves power watcher.MovementThreshold = 20; // minimum of 20m - avoids noise, saves power watcher.StatusChanged += (sender, args) => { if (args.Status == GeoPositionStatus.Ready) { // ready... } }; watcher.PositionChanged += (sender, args) => { double altitude = args.Position.Location.Altitude; double latitude = args.Position.Location.Latitude; double longitude = args.Position.Location.Longitude; }; watcher.Start(); // this can throw and we should call Stop()

System.Device.Location.dll

Page 20: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

where is that again?

CivicAddressResolver resolver = new CivicAddressResolver(); GeoCoordinate location = GetAlreadyDeterminedLocation(); resolver.ResolveAddressCompleted += (sender, args) => { if (args.Error == null) { string line1 = args.Address.AddressLine1; string line2 = args.Address.AddressLine2; string city = args.Address.City; // etc... } }; resolver.ResolveAddressAsync(location); System.Device.Location.dll

Page 21: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

is the phone moving? can I alert the user?

AccelerometerSensor.Default.ReadingChanged += (sender, args) => { if (args.Value.State == SensorState.Ready) { // Deltas X,Y,Z from -1 to +1 – should also check timestamp here if (args.Value.Value.Y >= -0.5) { // Help! I'm falling! Not sure this will help but... VibrateController.Default.Start(new TimeSpan(0, 0, 2)); } } }; // this could throw & we should stop it at some point AccelerometerSensor.Default.Start();

Microsoft.Devices.dll

Microsoft.Devices.Sensors.dll

Page 22: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo physical aspects of the phone

Page 23: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

input capabilities of the phone

hardware buttons ApplicationBar

soft input panel

multi-touch

Page 24: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo input capabilities

Page 25: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

reaching out to existing phone functionality

Launchers “fire and forget” an OS app

Choosers OS offers selection UI for app

WebBrowser control for HTML integration

Choosers

• EmailAddressChooserTask

• PhoneNumberChooserTask

• PhotoChooserTask

Launchers

• BingMapsTask

• CameraCaptureTask

• EmailComposeTask

• MarketplaceLauncher

• MediaPlayerLauncher

• PhoneCallTask

• SaveEmailAddressTask

• SavePhoneNumberTask

• SearchTask

• SMSComposeTask

• WebBrowserTask

Page 26: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo launchers, choosers, web browser

Page 27: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

reaching out to the cloud for notifications

MyApp

Cloud Service

request unique URI

URI

Service (or Client) with push data

URI

transmission of this URI is “out of band”

HTTP POST

Page 28: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

reaching out to the cloud for notifications

MyApp

Cloud Service

Service (or Client) with push data

HTTP POST notification types • raw – only to a foreground app • toast – foreground app or as a

toast if app is not foreground • tile – always to the tile & also to

the app if in the foreground

Page 29: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

demo push notifications

Page 30: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

reaching out to XNA functionality

XNA libraries offer additional functionality e.g. audio capture from phone’s microphone

covered in Paul’s talk next...

Page 32: Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.