31
Developing for Windows Phone 7 Zeddy Iskandar

Developing for Windows Phone 7

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Developing for Windows Phone 7

Developing for Windows Phone 7

Zeddy Iskandar

Page 2: Developing for Windows Phone 7

Agenda• What’s WP7 like (device demo)

• Tools to Get you Started

• WP7 UI Features

• Some codes

• How Publishing Works

Page 3: Developing for Windows Phone 7

Device Demo

Page 4: Developing for Windows Phone 7

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

Page 5: Developing for Windows Phone 7

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)

Page 6: Developing for Windows Phone 7

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

Page 7: Developing for Windows Phone 7

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

Page 8: Developing for Windows Phone 7

XAML PrimerStuff you need to know before coding

Page 9: Developing for Windows Phone 7

3 Containers1. Grid

2. StackPanel

3. Canvas

Page 10: Developing for Windows Phone 7

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>

Page 11: Developing for Windows Phone 7

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>

Page 12: Developing for Windows Phone 7

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

Page 13: Developing for Windows Phone 7

Most Used UI Elements

1. TextBlock

2. Image

3. Button

4. ListBox

Page 14: Developing for Windows Phone 7

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

Page 15: Developing for Windows Phone 7

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

Page 16: Developing for Windows Phone 7

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

Page 17: Developing for Windows Phone 7

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

Page 18: Developing for Windows Phone 7

WP7 UI FeaturesStuff you need to be aware of as devs

Page 19: Developing for Windows Phone 7

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"/>

Page 20: Developing for Windows Phone 7

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>

Page 21: Developing for Windows Phone 7

UI Gestures• Single Touch

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

• Multi Touch1. Pinch & Stretch

Page 22: Developing for Windows Phone 7

Panorama

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

Page 23: Developing for Windows Phone 7

Pivot

Only use if your app wants to filter contents

Page 24: Developing for Windows Phone 7

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

Page 25: Developing for Windows Phone 7

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

Page 26: Developing for Windows Phone 7

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

Page 27: Developing for Windows Phone 7

Some CodesReal-world coding samples

Page 28: Developing for Windows Phone 7

PublishingShow Me the Money!

Page 29: Developing for Windows Phone 7

Publishing Flow

Page 30: Developing for Windows Phone 7

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

Page 31: Developing for Windows Phone 7

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

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