Developing WP7 Appswith Silverlight<br />José Luis Latorre<br />Microsoft MVP, UX Specialist & Brainsiders CEO<br />http:/...
Generalni sponzori:<br />Organizatori:<br />Glavni sponzori:<br />Generalni medijski sponzor:<br />Sponzori:<br />Medijski...
Application Framework details<br />Windows Phone Frameworks<br />Camera<br />Device Integration<br />Launchers & Choosers<...
Whatis Silverlight?<br />Powerful Development Platform<br />Engaging, Interactive User Experiences<br />
Silverlighcapabilities<br />Data<br />Inputs<br /><ul><li>Language Integrated Query (LINQ)
LINQ to XML
XML
IsolatedStorage
Keyboard
Mouse
Touch
Ink</li></ul>Base Class Library (BCL)<br />XAML<br /><ul><li>Generics
Collections
Cryptography
Threading</li></ul>UI Core<br /><ul><li>Vector
Animation
Text
Images</li></ul>Windows Communication Foundation<br />Media<br /><ul><li>REST
RSS/ATOM
SOAP
Digital media capture & playback
VC1, WMA, MP3</li></li></ul><li>What Silverlight version do wehave?<br />It is Silverlight 3 but adding:<br />Performance ...
Whatmakes Silverlight so Special?<br />M<br />X<br />A<br />L<br />eXtensible<br />Application<br />Markup<br />Language<b...
Whatmakes Silverlight so Special?<br />Code<br />XAML<br />XAML maps to code<br />Anything in XAML can be done in code<br />
SilverligthAppModel - What’s a XAP?<br />myapp.xap<br />Tools<br />Common format for all Windows Phone apps & games<br />D...
Anoverview of a Silverlight appfor WP7<br />
Windows Phone application<br />Application<br />Frame<br />Page 3<br />Page 1<br />Page 2<br />
Silverlight Controls<br />Conformingto Metro DesignGuidelines.<br />Consistent Look & Feel.<br />Familiar toexisting Silve...
Output<br />
Media<br />Media support<br />H/W decode<br />MediaStreamSource<br />PlayReady DRM<br />XNA framework sound effect API<br ...
XNA for Windows Phone 7<br />Using XNA audio capabilitiesisneeded<br />UsingnamespaceMicrosoft.Xna.Framework.Audio<br />To...
Upcoming SlideShare
Loading in …5
×

Md2010 jl-wp7-sl-dev

1,273 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,273
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Md2010 jl-wp7-sl-dev

  1. 1.
  2. 2. Developing WP7 Appswith Silverlight<br />José Luis Latorre<br />Microsoft MVP, UX Specialist & Brainsiders CEO<br />http://silverlightguy.com<br />
  3. 3.
  4. 4. Generalni sponzori:<br />Organizatori:<br />Glavni sponzori:<br />Generalni medijski sponzor:<br />Sponzori:<br />Medijski sponzori:<br />Strateški partneri:<br />Službena PR agencija:<br />
  5. 5. Application Framework details<br />Windows Phone Frameworks<br />Camera<br />Device Integration<br />Launchers & Choosers<br />Windows Phone Controls<br />PhoneApplicationPage<br />PushNotification<br />WebBrowserControl<br />Sensors<br />PhoneApplicationFrame<br />Silverlight Presentation and Media<br />XNA Frameworks for Games<br />Controls<br />Drawing<br />IsolatedStorage<br />Drawing<br />GamerServices<br />Navigation<br />Shapes<br />Markup<br />Media<br />Audio<br />Media<br />Graphics<br />Content<br />Input<br />Application Object<br />Common Base Class Library<br />Diagnostics<br />Reflection<br />IO<br />Runtime<br />Resources<br />Globalization<br />Text<br />Location<br />Net<br />Collections<br />ComponentModel<br />Configuration<br />Security<br />Threading<br />ServiceModel<br />Linq<br />
  6. 6. Whatis Silverlight?<br />Powerful Development Platform<br />Engaging, Interactive User Experiences<br />
  7. 7. Silverlighcapabilities<br />Data<br />Inputs<br /><ul><li>Language Integrated Query (LINQ)
  8. 8. LINQ to XML
  9. 9. XML
  10. 10. IsolatedStorage
  11. 11. Keyboard
  12. 12. Mouse
  13. 13. Touch
  14. 14. Ink</li></ul>Base Class Library (BCL)<br />XAML<br /><ul><li>Generics
  15. 15. Collections
  16. 16. Cryptography
  17. 17. Threading</li></ul>UI Core<br /><ul><li>Vector
  18. 18. Animation
  19. 19. Text
  20. 20. Images</li></ul>Windows Communication Foundation<br />Media<br /><ul><li>REST
  21. 21. RSS/ATOM
  22. 22. SOAP
  23. 23. Digital media capture & playback
  24. 24. VC1, WMA, MP3</li></li></ul><li>What Silverlight version do wehave?<br />It is Silverlight 3 but adding:<br />Performance tuning<br />Input integration<br />H/W media and sensor integration<br />OS application model integration<br />Relaxed sandbox constraints<br />
  25. 25. Whatmakes Silverlight so Special?<br />M<br />X<br />A<br />L<br />eXtensible<br />Application<br />Markup<br />Language<br />XML<br />Declarative Markup<br /><Grid><br /><TextBlockFontSize="48" Text="Hello world" /><br /></Grid><br />
  26. 26. Whatmakes Silverlight so Special?<br />Code<br />XAML<br />XAML maps to code<br />Anything in XAML can be done in code<br />
  27. 27. SilverligthAppModel - What’s a XAP?<br />myapp.xap<br />Tools<br />Common format for all Windows Phone apps & games<br />Declarative, manifest-based installation<br />Integrated into security model of phone<br />
  28. 28. Anoverview of a Silverlight appfor WP7<br />
  29. 29. Windows Phone application<br />Application<br />Frame<br />Page 3<br />Page 1<br />Page 2<br />
  30. 30. Silverlight Controls<br />Conformingto Metro DesignGuidelines.<br />Consistent Look & Feel.<br />Familiar toexisting Silverlight developers.<br />TheyadapttothecurrentTheme.<br />
  31. 31. Output<br />
  32. 32. Media<br />Media support<br />H/W decode<br />MediaStreamSource<br />PlayReady DRM<br />XNA framework sound effect API<br />Supportspolyphony and looping<br />MediaElement<br />Only supports one MediaElement for page<br />VideoBrush is not supported<br />
  33. 33. XNA for Windows Phone 7<br />Using XNA audio capabilitiesisneeded<br />UsingnamespaceMicrosoft.Xna.Framework.Audio<br />TogetherwithSoundEffect and SoundEffectInstance<br />AddingtheWavsoundfile as a contentelementtotheproject.<br />// Audio<br />SoundEffectsoundEffect; <br />string soundName = "kaboom"; <br />// Loading and playing audio<br />soundEffect = contentManager.Load<SoundEffect>(soundName); soundEffect.Play(); <br />
  34. 34. Vibration<br />Makesthephonevibrateduring a specificduration<br />Useful for giving a tactile response totheuser.<br />Tonotifyusers of anupdate.<br />VibrateControllervc = VibrateController.Default;<br />vc.Start(TimeSpan.FromSeconds(3));<br />Microsoft.Devices.Sensors<br />
  35. 35. Input<br />
  36. 36. SIP I<br />SIP Stands for Software Input Panel.<br />TheTextBox Silverlight control integrateswith SIP<br />SIP supportsaround 60 differentInputScopes:<br />
  37. 37. SIP II<br />SIP can bepersonalizedwithseveralversions of thekeyboardthattheuser can selectbetween.<br />Buttheapplication can also show theoptimumkeyboard.<br />We use InputScopeto do that, for example:<br /><TextBoxGrid.Row="1" Name="tbNombre" Text=""><br /> <TextBox.InputScope><br /> <InputScope><br /> <InputScopeNameNameValue="PersonalGivenName"></InputScopeName><br /> </InputScope> <br /> </TextBox.InputScope><br /></TextBox><br />
  38. 38. A Silverlight “Hello World” for WP7<br />(link to demo)<br />
  39. 39. Accelerometer<br />Measures force applied on each axis over time.<br />+Y<br />-Z<br />-X<br />+X<br />+Z<br />-Y<br />
  40. 40. Accelerometer I<br />Getting data fromtheAccelerometer<br />Add a refferencetoMicrosoft.Devices.Sensors<br />Addthecorrespondingusing<br />Declare the variable AccelerometerSensor<br />Getaninstance of theAccelerometerSensor<br />+Y<br />usingMicrosoft.Devices.Sensors;<br />-Z<br />AccelerometerSensoraccelerometer;<br />-X<br />+X<br />if (accelerometer == null) <br />{ <br /> sensor accelerometer = new AccelerometerSensor();<br />}<br />+Z<br />-Y<br />
  41. 41. Accelerometer II<br />+Y<br />Getting data fromtheAccelerometer<br />Suscribe totheeventReadingChanged<br />Createtheeventhandler<br />Initializetheaccelerometer<br />accelSensor.ReadingChanged +=<br /> new EventHandler<AccelerometerReadingAsyncEventArgs>(AccelerometerReadingChanged);<br />-Z<br />publicvoidAccelerometerReadingChanged(objectsender, AccelerometerReadingAsyncEventArgs e)<br />{<br />accelReading.X = (float)e.Value.Value.X;<br />accelReading.Y = (float)e.Value.Value.Y;<br />accelReading.Z = (float)e.Value.Value.Z;<br />}<br />-X<br />+X<br />+Z<br />-Y<br />Accelsensor.Start();<br />
  42. 42. OS Integration<br />
  43. 43. ApplicationBar & ContextMenu<br />The «Application Bar» is a control systemthatprovides a quickaddition of a tool bar for our WP7 application.<br />ApartfromtheApplication Bar, applications can provideadditionaloptionslikeshowingoneor more menuelements.<br />Microsoft.Phone.Shell<br />
  44. 44. ApplicationBar & ContextMenu<br />By default wehave a sample XAML Code for quicklyenablingthisfeaturesonourapplications:<br /><phone:PhoneApplicationPage.ApplicationBar><br /> <shell:ApplicationBarIsVisible="True" IsMenuEnabled="True"><br /> <shell:ApplicationBarIconButtonIconUri=“/appbar_button1.png" Text="Button 1"/><br /> <shell:ApplicationBarIconButtonIconUri=“/appbar_button2.png" Text="Button 2"/><br /> <shell:ApplicationBar.MenuItems><br /> <shell:ApplicationBarMenuItemText="MenuItem 1"/><br /> <shell:ApplicationBarMenuItemText="MenuItem 2"/><br /> </shell:ApplicationBar.MenuItems><br /> </shell:ApplicationBar><br /></phone:PhoneApplicationPage.ApplicationBar><br />
  45. 45. Navigation: Frame and Page<br />Frame<br />Isthetopmostcontainer control.<br />PhoneApplicationFrameclass.<br />Containsthe page control and sytsemelements, likeSystemTray, app bar, etc..<br />Page<br />Fillstheentirecontentregion of theFrame.<br />Derives fromtheclassPhoneApplicationPage.<br />Contains a title.<br />Can haveitsownapplication bar.<br />
  46. 46. Orientation<br />In VS2010 we can add a Landscape Page or a Portrait Page.<br />TheonlydifferenceisonthepropertySupportedOrientationwhich can be:<br />Portrait<br />Landscape<br />PortraitOrLandscape<br />Wecan’tchangethe page orientation in code.<br />Butwe can reacttoitschangesthroughtheOrientationChangedevent.<br />
  47. 47. Silverlight Toolkit<br />(link to demo)<br />
  48. 48.
  49. 49. jose@brainsiders.com - @joslat<br />

×