Developing for Windows Phone 7

Preview:

DESCRIPTION

Presented on 26th Feb 2011 at Tech-Out event sponsored by Infusion, Techies, Tech.Sessions and Microsoft Middle East.

Citation preview

Developing for Windows Phone 7

Zeddy Iskandar

Agenda• What’s WP7 like (device demo)

• Tools to Get you Started

• WP7 UI Features

• Some codes

• How Publishing Works

Device Demo

Tools of Trade• Windows Phone Developer Tools (WPDT)

o http://bit.ly/WPDT-ISO

• WPDT Jan 2011 Update (Copy-Paste)o http://bit.ly/WPDT-JanUpdate

• Training Kits (3)o http://bit.ly/WP7-TrainingKits

• Charles Petzold Free e-Booko http://bit.ly/WP7-Ebook

• Code Sampleso http://bit.ly/WP7-CodeSamples

Which Device to Buy?• SIM-Free Windows Phones (not carrier-locked):

o Samsung Focus SGH-i917 ($574.99)o HTC Surround T8788 ($574.99)o LG Quantum C900 (QWERTY keyboard) ($544.99)o HTC Trophy ($604.99)o Samsung Omnia 7 ($614.99)o HTC HD7 ($579.99)o Dell Venue Pro (Vertical keyboard) ($659.99)o HTC 7 Pro (QWERTY keyboard) ($694.99)

Device Specs• All must meet Microsoft’s minimum requirements:

o Qualcomm Snap Dragon (QSD8250) 1.0 GHzo Capacitive 4-point multi-touch screeno WVGA (480x800) resolutiono DirectX9 rendering-capable GPUo 256MB RAMo 8GB Flash Memoryo 5MP Camera with LED Flasho FM Radio Tunero Accelerometer with Compasso Ambient Light Sensoro Proximity Sensoro Assisted GPS

SideLoading apps• You need:

o AppHub Account (http://create.msdn.com)o Zune Software (http://www.zune.net)

• Run Zune, Connect Device, Run Windows Phone Developer Registration app from WPDT Start Menu

XAML PrimerStuff you need to know before coding

3 Containers1. Grid

2. StackPanel

3. Canvas

Grid<Grid ShowGridLines="True" Margin="12,0,12,0"> <Grid.RowDefinitions> <RowDefinition Height="auto" /> <RowDefinition /> <RowDefinition Height="auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBox Text="1st row 1st column" TextWrapping="Wrap" Grid.Column="0" Grid.Row="0" /> <TextBox Text="3rd row 1st column" TextWrapping="Wrap" Grid.Column="0" Grid.Row="2" /> <Button Content="1st row 3rd column" FontSize="17" Grid.Column="1" Grid.Row="0" /> <Button Content="3rd row 2nd column" FontSize="17" Grid.Column="1" Grid.Row="2" /></Grid>

StackPanel<StackPanel Margin="20"> <Rectangle Fill="Red" Width="50" Height="50" Margin="5" />

<Rectangle Fill="Blue" Width="50" Height="50“ Margin="5" />

<Rectangle Fill="Green" Width="50" Height="50“ Margin="5" />

<Rectangle Fill="Purple" Width="50" Height="50“ Margin="5" />

</StackPanel>

Canvas<Canvas Background="Transparent">

<Rectangle Canvas.Left="30" Canvas.Top="200"Fill="red" Width="200" Height="200" />

</Canvas>

*Recommended if you don’t need the auto-adjust features of Grid & StackPanel better performance

Most Used UI Elements

1. TextBlock

2. Image

3. Button

4. ListBox

TextBlock<TextBlock Text="Hello, world!" />

Image<Image Source="licorice.JPG" />

Button<Button Content="Locate Me" Height="80" HorizontalAlignment="Left" Margin="0,6,0,0" Name="btnLocateMe" VerticalAlignment="Top“ Width="204" Click="btnLocateMe_Click" />

ListBox<ListBox Name=“lbCities" ItemsSource="..."/>

WP7 UI FeaturesStuff you need to be aware of as devs

Application Bar<phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">

<shell:ApplicationBarIconButton IconUri="/Icons/appbar.check.rest.png" Text="Save" Click="SaveClicked"/> <shell:ApplicationBarIconButton IconUri="/Icons/appbar.cancel.rest.png" Text="Cancel" Click="CancelClicked"/>

Application Bar Menu<phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">

<shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem Text="Save" Click="SaveClicked"/> <shell:ApplicationBarMenuItem Text="Cancel" Click="CancelClicked"/> </shell:ApplicationBar.MenuItems>

</shell:ApplicationBar></phone:PhoneApplicationPage.ApplicationBar>

UI Gestures• Single Touch

1. Tap2. Double Tap3. Pan4. Flick5. Touch & Hold

• Multi Touch1. Pinch & Stretch

Panorama

Only use if your app has features similar to XBox Live and Zune Marketplace.

Pivot

Only use if your app wants to filter contents

Application FrameworkNo you can’t intercept that Phone call and auto-reject calls

KernelHardware BSP

App Model UI Model Cloud Integration

Applications

App managementLicensingChamber isolationSoftware updates

Shell frame Session managerDirect3DCompositor

Xbox LIVEBingLocationPush notificationsWindows Live ID

Your App UI and logic

A-GPS Accelerometer Compass Light ProximityMedia Wi-Fi Radio Graphics

SecurityNetworkingStorage

Frameworks

Silverlight XNA HTML/JavaScript

CLR

Hardware Foundation

Software Architecture

Windows Phone 7 Series Frameworks

Details

Common Base Class Library

Collections ComponentModel Configuration

DiagnosticsReflection IO

Security Threading

Runtime Resources Globalization TextLocation Net

ServiceModel Linq

Application Object

Silverlight Presentation and Media

XNA Frameworks for Games

Windows Phone Frameworks

NavigationShapes Markup Media

Controls Drawing IsolatedStorage

AudioMedia GraphicsInput

Drawing GamerServices

Content

PhoneApplicationPage

PushNotification

WebBrowserControl

SensorsPhoneApplicationFra

me

CameraDevice

IntegrationLaunchers &

ChoosersWindows Phone

Controls

Some CodesReal-world coding samples

PublishingShow Me the Money!

Publishing Flow

5 Step Process1. Upload .XAP Package

2. Write App Description

3. Upload the required ArtWork

4. Set App Price & Distribution Market

5. Submit App for Certification

There’s a complete walkthrough herehttp://bit.ly/WP7-PublishWalkthru

Terima Kasih!• http://twitter.com/zeddyiskandar

• Windows Phone Developer Bloghttp://windowsteamblog.com/windows_phone

Recommended