An end-to-end experience of Windows Phone 7 development (Part 2)


Published on

DevDays 2011 South Africa - An end-to-end experience of Windows Phone 7 development (Part 2)

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

An end-to-end experience of Windows Phone 7 development (Part 2)

  1. 1.
  2. 2. Rudi Grobler<br /><br />@rudigrobler<br />An end-to-end experience of Windows Phone 7 development<br />TRACK: NEXT GENERATION<br />
  3. 3. agenda<br />Two part session<br />The basics<br />Build app from File -> New…<br />Advanced tips and tricks<br />Loads of content<br />Caveat: this is NOT a marketing session on how cool the phone is… This is how to build a application end-to-end<br />Feel free to ask questions ANY time...<br />Windows Phone 7 App Smackdown<br />
  4. 4. applications<br />Omoplata<br />Scrumy7<br />Podium<br />Professional Audio Recorder<br />7MC Gofer<br />Brew Master<br />
  5. 5. Brew Master<br />demo<br />
  6. 6. hardware foundation<br />Capacitive touch<br />4 or more contact points<br />Sensors<br />A-GPS, Accelerometer, Compass, Light, Proximity<br />Camera<br />5 mega pixels or more<br />Multimedia<br />Common detailed specs, Codec acceleration<br />800<br />Memory<br />256MB RAM or more, 8GB Flash or more<br />GPU<br />DirectX 9 acceleration<br />CPU<br />Qualcomm MSM8x55 1Ghz (800Mhz) or higher<br />480<br />Hardware buttons | Back, Start, Search<br />Qualcomm MSM7x30 & Gyroscope<br />
  7. 7. common platform capabilities<br />.NET<br />Superset of Silverlight 3.0<br />Input<br />Touch<br />Hardware buttons<br />Media<br />Digital media capture & playback<br />Media library access<br />Data<br />Isolated storage<br />LINQ<br />Object<br />XML<br />WCF<br />SOAP & REST services<br />Phone Access<br />Integrated access to phone UI<br />Sensors<br />Pickers for contacts and photos<br />Integrated with Cloud Services<br />App deployment & Updates<br />Notifications<br />Location<br />Xbox LIVE<br />
  8. 8. Two flavours of applications<br />Silverlight<br />XNA<br />Modern XAML/event-driven application UI framework<br />Rapid creation of visual stunning applications<br />Metro-themed UI controls<br />500,000 developers spanning Windows and web<br />High performance game framework<br />Rapid creation of multi-screen 2D & 3D games<br />Rich content pipeline<br />Mature, robust, widely adopted technology spanning Xbox 360, Windows and Zune<br />XNA/Silverlight Interop<br />
  9. 9. silverlight for windows phone<br />Silverlight for Windows Phone is…<br />Silverlight 3<br />minus a few things that didn’t make sense<br />plus a few Silverlight 4 things that did<br />plus phone specific API & “under the hood” improvements<br />Silverlight 4 compatibility (1500+ new APIs)<br />
  10. 10. Getting started…<br />demo<br />
  11. 11. navigation<br />Applications are built like web sites<br />Functionality is split into pages<br />Forward navigation via links<br />Backward navigation via Back<br />Previous applications (pages) are in the back stack<br />Can override back button behavior (but be careful)<br />Transient pages<br />Payload can be send with navigation request<br />NO back to home buttons!!!<br />Deep linking<br />
  12. 12. Navigation<br />demo<br />
  13. 13. familiar web concepts<br />Phone application<br />Provides UI represented as XAML pages connected into cross-app flows by URI’s<br />Web application<br />Provide media represented as HTTP resources linked by URL’s<br />Shell frame<br />Requests pages, renders UI, and handles navigation across apps<br />Web browser<br />Requests HTTP resources, renders them, and handles navigation across sites<br />History and tabs<br />Groups together sequences of HTTP resources corresponding to a user’s activity across sites<br />Sessions and back stack<br />Groups together sequences of pages corresponding to a user’s activity across apps<br />
  14. 14. launchers and choosers<br />Windows Phone execution model isolates every application in its own sandbox<br />Apps cannot directly access information stores such as contacts<br />Cannot directly invoke other applications such as phone or messaging<br />Launchers and Choosers allow applications indirect access to the useful phone features<br />Launchers and Choosers APIs invoke distinct built-in applications that replace the currently running applications<br />
  15. 15. launchers and choosers<br />Launcher<br />Launches one of the built-in applications though which a use completes a task<br />No data is returned to calling application<br />Example: PhoneCallTask<br />Chooser<br />Launches one of the built-in applications through which a user completes a task and which returns some data to calling application<br />When caller completes, calling application is activated and supplied with the Chooser result<br />Example: PhotoChooserTask<br />
  16. 16. launchers and choosers<br />Launchers<br />Choosers<br />EmailComposeTask<br />MediaPlayerLauncher<br />PhoneCallTask<br />SearchTask<br />SMSComposeTask<br />WebBrowserTask<br />MarketplaceDetailTask<br />MarketplaceHubTask<br />MarketplaceReviewTask<br />MarketplaceSearchTask<br />CameraCaptureTask<br />EmailAddressChooserTask<br />PhoneNumberChooserTask<br />PhotoChooserTask<br />SaveEmailAddressTask<br />SavePhoneNumberTask<br />Bing<br />
  17. 17. Launchers and Choosers<br />demo<br />
  18. 18. choosers and the execution model<br />IMPORTANT! When you launch a Launcher or Chooser, your app is terminated<br />When task completes, your app may be reactivated and a new app instance created (SOMETIMES)<br />The following choosers and tasks have relaxed thombstoning policy<br />PhotoChooserTask<br />CameraCaptureTask<br />MediaPlayerLaunchTask<br />EmailAddressChooser<br />PhoneNumberChoose<br />
  19. 19. panoramas<br />
  20. 20. panoramas<br />
  21. 21. pivots<br />
  22. 22. panorama vs pivot<br />Pivot<br />Panorama<br />Filter same data on different views (the “inbox” is a great example of this) <br />Optimized for current screen size <br />Filter of data doesn’t have to be same view (agenda/day) <br />Related content is ok to pivot on as long as related content is truly related <br />Focused <br />“Virtualized”<br />Horizontal broad canvas, not confined to current screen size <br />A ‘top layer’ view into underlying experiences/tasks <br />Use white space <br />Performance -> Panorama loads all the pages on startup<br />Exploratory in nature<br />
  23. 23. Adding and using the Pivot<br />demo<br />
  24. 24. misuse of common controls<br />Use the WP7 common controls appropriately.<br />Don’t use sliders, toggles or map controls under panoramas or pivots –as they both need the same gestures to work.<br />
  25. 25. MVVM on the Phone<br />Singleton<br />App.xaml<br />Model<br />PhoneApplicationPage<br />ViewModel<br />PhoneApplicationPage<br />PhoneApplicationPage<br />PhoneApplicationPage<br />View<br />Data<br />Bindable properties<br />Business logic<br />PhoneApplicationFrame<br />PhoneApplicationPage<br />Controls<br />Code-behind<br />Wanna learn more? <br /> Check out Silverlight Kung-fu<br /> Starting 16:30 @ track 3<br />
  26. 26. MVVM phone style…<br />demo<br />
  27. 27. networking on the phone<br />Support for networking features<br />WCF/ASMX<br />HttpWebRequest<br />WebClient<br />No cross-domain policy file required<br />Not supported<br />Sockets<br />Custom WCF Bindings<br />WCF RIA Services<br />NTLM authentication<br />
  28. 28. WCF/ASMX services<br />Can “Add Reference” from Windows Phone projects to automatically generate proxy classes<br />ASMX should just work<br />WCF requires that you use basicHttpBinding<br />
  29. 29. OData<br />Server:<br />WCF Data Services provides an extensible tool for publishing data using REST based interface<br />Publishes and consumes data using Odata web protocol <br />Format is XML or JSON<br />Client:<br />Download Odata Client Library for Windows Phone<br /><br />FULL parity with Silverlight (Including LINQ and Add Service Reference support)<br />
  30. 30. Getting data<br />demo<br />
  31. 31. HTTPWebRequestvsWebClient<br />Use HttpWebRequest whenever possible<br />Use background thread and marshal back to UI thread (Using Dispatcher.BeginInvoke)<br />WebClient is “easier” to use but happens on the UI thread no matter where it was spawned (Bug)<br />6 Parallel requests limit<br />WebClient bug fixed<br />
  32. 32. marketplace<br />Enhanced Discovery<br />Easy to find great applications & games<br />Fun to browse the marketplace<br />Simple & Reliable Acquisition<br />Try before you buy<br />Buying and downloading content is a breeze<br />Payment flexibility (Monthly billing and credit card)<br />Easy application updates<br />South Africa WILL BE supported…<br />
  33. 33. marketplace<br />It costs nothing to download the Windows Phone SDK and write code using the emulator<br />To sell applications you need to register as a developer<br />This costs $99 a year and <br />allows you to publish any <br />number of fee applications <br />and up to 99 free applications<br />Each additional application <br />costs $20<br />Students can sign up for free<br />Revenue sharing (30/70)<br />
  34. 34. yalla apps<br />Are you looking for a viable alternative to publish your WP7 Apps to the Windows Phone Marketplace? Yalla Apps provides the solution by publishing your apps to the Marketplace on your behalf. <br />Publish your apps to the Windows Phone marketplace<br />and unlock your device for testing<br />Share and download code in the Module Market<br />Smooth certification process<br />Join the developer community<br />
  35. 35. yalla apps<br />Updated<br />Device Unlocking<br />Yalla Apps offers a device unlock service which allows you to unlock your Windows Phone 7 to debug and test applications. The device unlock is accomplished using remote assistance access to your development machine and charged 0 Credits for the first device and 50 credits per additional device.<br />
  36. 36. Yalla Apps<br />demo<br />
  37. 37. @rudigrobler<br />Slides, demos, etc…<br /><br />questions<br />
  38. 38. Don’t forget the Xbox Kinectshow-down after sessions this evening!<br />
  39. 39. DevDays 2011 Sponsors<br />PLATINUM SPONSOR<br /><br />SILVER SPONSOR<br /><br />SILVER SPONSOR<br /><br />
  40. 40. Keep in Touch<br /><br />@msdevsa<br /><br />
  41. 41. © 2008 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.<br />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.<br />