iat202 tips and tricks on windows phone 7 development

31
8 – 10 March 2011 | Dubai, UAE Zeddy Iskandar Consultant Infusion Tips and Tricks on Windows Phone 7 Development SESSION CODE: IAT202

Upload: zeddy-iskandar

Post on 26-Dec-2014

836 views

Category:

Technology


2 download

DESCRIPTION

This is the session IAT202 Tips and Tricks on Windows Phone 7 Development that I presented during Microsoft TechEd Middle-East conference on 10th March 2011.

TRANSCRIPT

Page 1: IAT202 Tips and Tricks on Windows Phone 7 Development

8 – 10 March 2011 | Dubai, UAE

Zeddy IskandarConsultantInfusion

Tips and Tricks on Windows Phone 7 Development

SESSION CODE: IAT202

Page 2: IAT202 Tips and Tricks on Windows Phone 7 Development

2

About meinfusionite, mvp, mobile app dev…

Page 3: IAT202 Tips and Tricks on Windows Phone 7 Development

3

Agenda

Necessary ToolkitsLearning & Sample CodesGPS Emulator & Bing GeoCodeMarketplace Tips

Page 4: IAT202 Tips and Tricks on Windows Phone 7 Development

4

NECESSARY TOOLKITSdon‘t reinvent the wheel

Page 5: IAT202 Tips and Tricks on Windows Phone 7 Development

5

The Noun Project (Free Iconography)

http://thenounproject.com

Page 6: IAT202 Tips and Tricks on Windows Phone 7 Development

6

Windows Phone Toolkit

AutoCompleteBox ContextMenu DatePicker GestureService/GestureListener ListPicker LongListSelector

Page Transitions PerformanceProgressBar TiltEffect TimePicker ToggleSwitch WrapPanel

http://bit.ly/WP7-PhoneToolkit

Page 7: IAT202 Tips and Tricks on Windows Phone 7 Development

7

WinPhone Toolkit Demo

Page 8: IAT202 Tips and Tricks on Windows Phone 7 Development

8

Coding4Fun Toolkit

About Prompt Input Prompt Progress Overlay Round Button

Round Toggle Button Memory Counter TimeSpan Picker Toast Prompt

http://bit.ly/WP7-Coding4Fun

Page 9: IAT202 Tips and Tricks on Windows Phone 7 Development

9

Code4Fun Toolkit Demo

Page 10: IAT202 Tips and Tricks on Windows Phone 7 Development

10

LEARNINGfloat before you swim

Page 11: IAT202 Tips and Tricks on Windows Phone 7 Development

11

31 Days of Windows Phone

Page Navigation

The Back Button Paradigm

Device Orientation

System Theming

Application Bar

Launchers

Choosers

Debugger Tips

Input Scope (on-screen Keyboard)

Accelerometer

Vibration Controller

Location Services

Tombstoning

Isolated Storage http://bit.ly/WP7-31days

Panorama Control

Pivot Control

WebBrowser Control

Push Notification API

Map Control

Apps vs. Games

Trial Versions of Your App

Embedding Fonts

Talking to Existing APIs (like Twitter)

Sharing Your App With Other Developers

Windows Phone Marketplace

Advertising SDK

Animations

Gestures

Charting

Page 12: IAT202 Tips and Tricks on Windows Phone 7 Development

12

Tombstoningvoid Application_Launching (object sender, LaunchingEventArgs e) { } void Application_Activated (object sender, ActivatedEventArgs e) { } void Application_Deactivated (object sender, DeactivatedEventArgs e) { } void Application_Closing (object sender, ClosingEventArgs e) { }

Source: CodeGuru

Page 13: IAT202 Tips and Tricks on Windows Phone 7 Development

13

Providing Trial

using Microsoft.Phone.Marketplace;

var li = new LicenseInformation();

if ( !li.IsTrial() ) { // paid users only} else { // trial users }

Source: CodeGuru

Page 14: IAT202 Tips and Tricks on Windows Phone 7 Development

14

Launchers – Common Phone Tasks

EmailComposeTask

MarketplaceDetailTask – takes the user to a specific product

MarketplaceHubTask – show a category of apps (or all)

MarketplaceReviewTask – review the current application

MarketplaceSearchTask – search the marketplace

MediaPlayerLauncher – plays the media file

Page 15: IAT202 Tips and Tricks on Windows Phone 7 Development

15

Launchers – Common Phone Tasks (2)

PhoneCallTask – displays phone number and name. User needs to press Call manually

SearchTask – Bing search

SMSComposeTask – specify recipients and message body, but user needs to press Send manually

WebBrowserTask –navigates to specified URL

Page 16: IAT202 Tips and Tricks on Windows Phone 7 Development

16

Choosers – they return Data!

Handle the returned data well

CameraCaptureTask –take a picture

EmailAddressChooserTask – select email address from contacts

PhoneNumberChooserTask –select phone number from contacts

PhotoChooserTask – select a photo from album

var cct = new CameraCaptureTask(); cct.Completed += cct_Completed; cct.Show();

void cct_Completed(.., PhotoResult e) { var bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); someImage.Source = bmp; }

Page 17: IAT202 Tips and Tricks on Windows Phone 7 Development

17

Haptic Feedback (vibrate)

indicate button is pressed

something failed

new content received (new tweets, etc)

game feedback (explosion, etc.)

var vc = VibrateController.Default; vc.Start(TimeSpan.FromMilliseconds(100));

Page 18: IAT202 Tips and Tricks on Windows Phone 7 Development

18

GPS EMULATORdon‘t waste your device’s battery

Page 19: IAT202 Tips and Tricks on Windows Phone 7 Development

19

Reusable Coordinate Retriever

#define GPS_EMULATOR Comment for Real DeviceUncomment for Emulator

Call from BackgroundWorker

Returns when Coordinate is retrieved, or when TIMEOUT occurs

http://bit.ly/WP7-GPS

Page 20: IAT202 Tips and Tricks on Windows Phone 7 Development

20

Reusable Reverse Geocoding

Returns Address object given a Latitude & Longitude pair

Call from BackgroundWorker

http://bit.ly/WP7-ReverseGeocode

Page 21: IAT202 Tips and Tricks on Windows Phone 7 Development

21

MARKETPLACEprepare before you hit submit

Page 22: IAT202 Tips and Tricks on Windows Phone 7 Development

22

Do it right the first time

It takes 5 business days to get published, so:Read App Cert Requirements guide http://bit.ly/WP7-AppCertBuild in Release ModeTest, Test, Test on Real Device before uploading .XAP

If publishing fails, you will get PDF file:Why it failsSteps to reproduce

After you fix the failure, you will need to wait another 5 days :)

Page 23: IAT202 Tips and Tricks on Windows Phone 7 Development

23

Certification Status (1)

Submission in Progress = You need to click the Submit button (or click it again!) to finish the submission.

Ready for Testing = The app has been submitted, but hasn't been placed "in the queue" for testing.

Testing in Progress = The app is in the queue and the next tester available will get to work testing it. The app will usually stay in this status until it is ready for signing or has failed certification.

Page 24: IAT202 Tips and Tricks on Windows Phone 7 Development

24

Certification Status (2)

Ready for Signing = The app has passed certification and is awaiting the next signing batch so it can be published.

Ready for Publishing = The app has been certified and signed, but you did not select the auto-publish option when you submitted it. You need to go into the app's detail page and publish it yourself!

Published to Marketplace = The app has been through the entire process and is now "published".

Page 25: IAT202 Tips and Tricks on Windows Phone 7 Development

25

Certification Status (3)

Certification Failed = The app has failed certification and you will need to change it before you submit it again. There should be a failure report that can be downloaded from the app’s detail page. (hint: The download is accessed from the Action dropdown.)

None = It is unknown what this means. Apps with a status of None are sometimes delayed for several days. If your app has a status of “None” for more than 48 hours I would put in a support request.

Page 26: IAT202 Tips and Tricks on Windows Phone 7 Development

26

Marketplace Artwork

Create icon from scratchGeneric icon will fail your publishing status (5 days remember?)

Screenshots have to be 480x800

Don’t forget the 1000x800 background image It’s used for “Featured App”, you want to make it pretty & right

Don’t forget the 3 extra icons:99x99

173x173

200x100

Page 27: IAT202 Tips and Tricks on Windows Phone 7 Development

27

Marketplace Screenshots

Use the free Windows 7 Snippet Tool

Zoom to 100%

Disable Frame Rate Counter

Page 28: IAT202 Tips and Tricks on Windows Phone 7 Development

28

Marketplace Screenshots

This app deploys .XAP

But to Unlocked Device!

Unlocked = users with Developer Account

The same .XAP can be uploaded by receiver to Marketplace

For sharing internally, not externally

Page 29: IAT202 Tips and Tricks on Windows Phone 7 Development

8 – 10 March 2011 | Dubai, UAE

Complete an evaluation on CommZone and enter to win an HP laptop!

Page 30: IAT202 Tips and Tricks on Windows Phone 7 Development

30

Q & A

http://twitter.com/zeddyiskandar

Page 31: IAT202 Tips and Tricks on Windows Phone 7 Development

© 2011 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.