NNUG Trondheim 30.09.2010 - Windows Phone 7

1,004 views

Published on

Introduksjon til Windows Phone 7 som plattform. Presentert på NNUG møte i Trondheim 30.09.2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,004
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

NNUG Trondheim 30.09.2010 - Windows Phone 7

  1. 1. Windows Phone 7<br />Jonas Follesø<br />NNUG Trondheim, 30. september 2010<br />
  2. 2. ABOUT ME<br />JONAS FOLLESØ<br />jonas@follesoe.no<br />http://jonas.follesoe.no<br />@follesoe<br />
  3. 3. AGENDA:- WP7 PLATFORM- PHONE APIs- TDD- BLEND 4- DEMOS!<br />http://www.flickr.com/photos/20792787@N00/2248623391/<br />
  4. 4. WINDOWS PHONE 7A FRESH START!<br />
  5. 5. XNA FOR GAMESSILVERLIGHT FOR APPS<br />
  6. 6. KNOW SILVERLIGHT?THEN YOU KNOW WP7!<br />
  7. 7. HELLO WORLDDEMO<br />
  8. 8. METRO DESIGN LANGUAGE<br />
  9. 9.
  10. 10.
  11. 11.
  12. 12.
  13. 13.
  14. 14. PIVOT CONTROL<br />
  15. 15. HUB CONTROL<br />
  16. 16. BLEND 4DEMO<br />
  17. 17. LAUNCHERS & CHOOSERS<br /><ul><li>CameraCaptureTask
  18. 18. EmailAddressChooserTask
  19. 19. EmailComposeTask
  20. 20. MarketplaceDetailTask
  21. 21. MarketplaceHunTask
  22. 22. MarketplaceReviewTask
  23. 23. MarketplaceSearchTask
  24. 24. MediaPlayerLauncher
  25. 25. PhoneCallTask
  26. 26. PhoneNumberChooserTask
  27. 27. PhotoChooserTask
  28. 28. SaveEmailAddressTask
  29. 29. SavePhoneNumberTask
  30. 30. SearchTask
  31. 31. SmsComposeTask
  32. 32. WebBrowserTask</li></ul>http://www.flickr.com/photos/mad_house_photography/4440871380/<br />
  33. 33. LAUNCH BUILT IN APP WITH SOME DATA<br />http://www.flickr.com/photos/28634332@N05/4054766770/<br />
  34. 34. privatevoidsmsCompose_Click(objectsender, RoutedEventArgse)<br />{<br />varsmsCompose=newSmsComposeTask();<br />smsCompose.To="97706660";<br />smsCompose.Body="Hello NNUG!";<br />smsCompose.Show();<br />}<br />
  35. 35. LAUNCH BUILT IN APP TO CHOOSE SOME DATA <br />
  36. 36. privatevoidchoose_Click(objectsender, RoutedEventArgse)<br />{<br />varemailChooser=newEmailAddressChooserTask();<br />emailChooser.Completed+=emailChooser_Completed;<br />emailChooser.Show();<br />}<br />privatevoidemailChooser_Completed(objectsender, EmailResulte)<br />{<br />if(e.TaskResult==TaskResult.OK)<br />email.Text=e.Email;<br />}<br />
  37. 37. CHOSER & LAUCHER DEMO<br />
  38. 38. EXECUTION MODEL & TOMBSTONING<br />http://www.flickr.com/photos/9810948@N05/1583506787/<br />
  39. 39. NO MULTI TASKINGBUT...<br />http://www.flickr.com/photos/n3ptun3r/3376697490/<br />
  40. 40. FAST ACTIVATION & DEACTIVATION GIVES IMPRESSION OF APP RUNNING IN BACKGROUND<br />http://www.flickr.com/photos/cirox/363284194/<br />
  41. 41. PAGE STATE<br /><ul><li>Poisition of ScollViewer
  42. 42. Content of TextBox
  43. 43. State of other UI elements
  44. 44. OnNavigatedTo & OnNavigatedFrom</li></li></ul><li>APP STATE<br /><ul><li>State not associated with spesific page
  45. 45. Managed by PhoneApplicationService</li></li></ul><li>PERSISTENT DATA<br /><ul><li>Data shared by all instances of app
  46. 46. Save and loaded from Isolated Storage</li></li></ul><li>TRANSIENT STATE<br /><ul><li>Data for instance of application
  47. 47. Stored in State dictionary
  48. 48. Similar to cache</li></li></ul><li>Launching<br />Running<br />Deactivating<br />Activating<br />Closing<br />Chooser/Task/Other<br />
  49. 49. PUSH NOTIFICATIONS WHEN APP IS NOT RUNNING<br />
  50. 50. TWO TYPES OF NOTIFICATIONS<br />
  51. 51. WP7 PUSH NOTIFICATIONS<br />Your WP Application<br />Hand off channel URL<br />2<br />Your Web Application<br />PUSH CLIENT<br />Notification Namespaces<br />Push Library<br />4<br />Push<br />message<br />3<br />Push message<br />1<br />Open Channel<br />Microsoft Push Notification Services<br />
  52. 52. PUSH NOTIFICATIONS DEMO<br />http://www.flickr.com/photos/kozloski/2306510520/<br />
  53. 53. privatevoidopen_Click(objectsender, RoutedEventArgse)<br />{<br />varchannel=HttpNotificationChannel.Find("NNUG");<br />if (channel==null)<br /> {<br />channel=newHttpNotificationChannel("NNUG"); <br /> }<br />channel.ChannelUriUpdated+=channel_ChannelUriUpdated;<br />channel.ShellToastNotificationReceived+=<br />channel_ShellToastNotificationReceived;<br />channel.Open();<br />}<br />
  54. 54. privatevoidchannel_ShellToastNotificationReceived<br />(objectsender, NotificationEventArgse)<br />{<br />foreach (vartextine.Collection)<br />output.Text+=text+" ";<br />}<br />
  55. 55. ISOLATED STORAGEFOR SIMPLE DATA STORAGE<br />
  56. 56. NOSQLFOR WP7?<br />
  57. 57. ISOLATED STORAGEDEMO<br />http://www.flickr.com/photos/omarrun/4672531253/in/photostream<br />
  58. 58. ACCELEROMETERDEMO<br />http://www.flickr.com/photos/howzey/2880455762/<br />
  59. 59. LOCATION AWARENESSIS KEY WHEN ON THE GO<br />
  60. 60. SAME API IN .NET 4 & WP7<br />http://www.flickr.com/photos/photograham/198324031/<br />
  61. 61. privatevoidstart_Click(objectsender, System.Windows.RoutedEventArgse)<br />{<br />varwatcher=newGeoCoordinateWatcher(GeoPositionAccuracy.High);<br />watcher.PositionChanged+=watcher_PositionChanged;<br />watcher.Start();<br />}<br />privatevoidwatcher_PositionChanged(objectsender, <br />GeoPositionChangedEventArgs<GeoCoordinate>e)<br />{<br />varlocation=e.Position.Location;<br />varlat=location.Latitude;<br />varlon=location.Longitude;<br />}<br />
  62. 62. TDD FUNDAMENTALPRACTICE<br />http://www.flickr.com/photos/mad_house_photography/4440871380/<br />
  63. 63. TDDDEMO<br />
  64. 64. FLIGHTS NORWAYMONITORARRIVALS AND DEPARTURES<br />http://www.flickr.com/photos/svenwerk/2181849280/<br />
  65. 65. RESTSERVICESWITH FLIGHT INFORMATION<br />http://flydata.avinor.no/<br />http://open.bekk.no/2009/12/13/hva-skjer-nar-man-gir-bort-flydata-gratis/<br />
  66. 66. MVVMPATTERN FOR BINDABLE UI<br />
  67. 67. APP LOGIC IN CODE BEHIND IS HARD TO TEST AND MAINTAIN<br />VIEW<br />XAML<br />DataModel<br />Code-Behind<br />EventHandlers<br />
  68. 68. SEPARATE USINGMVVM<br />VIEW<br />XAML<br />Code-Behind<br />Change notification<br />Data-binding and commands<br />VIEW MODEL<br />Data Model<br />State + Operations<br />
  69. 69. MVVM SHOULD BE LIGHT WEIGHT<br />http://www.flickr.com/photos/treehouse1977/2892417805/<br />
  70. 70. http://mvvmlight.codeplex.com/<br />
  71. 71. FLIGHTS NORWAYDEMO<br />
  72. 72. DEMOWP7 TWITTER CLIENT<br />
  73. 73. SUMMARY:- WP7 PLATFORM- PHONE APIs- TDD- BLEND 4- DEMOS!<br />http://www.flickr.com/photos/20792787@N00/2248623391/<br />
  74. 74. FORK ME ON GITHUB<br />http://github.com/follesoe/FlightsNorway<br />http://github.com/follesoe/FrontEnd2010<br />
  75. 75. Jonas Follesø<br />Senior Consultant<br />+47 977 06660<br />Jonas.folleso@bekk.nojonas@follesoe.no<br />

×