Shape 2013 developing multi targeting windows store and windows phone apps


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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

No notes for slide
  • Itisimportant and youknowwhy!YouhavetwomainreasonsYouknowhowtechnologyevolvesthesedays and youwantto be ready!You do notwantto be closedintoonlyonedevice and technology, right?
  • Clean code: Easy to understand. Easy to modify. Easy to test. Works correctlySOLID  Single responsibility, Open-closed principle, Liskov substitution, Interface segregation and Dependency inversionSTUPIDSingletonTight couplingUntestabilityPremature OptimizationIndescriptive NamingDuplication
  • The thread-handling dispatchers are different on Windows Phone and Windows 8. In windows 8, we use an element of the UI Core while in Windows Phone, we have a dispatcher that has been assigned to our app deployment. So, if you’re anything like me, you say “well it was worth a shot, time to give up”.
  • Means Decouples
  • Model – Not UI relatedView Model – Encapsulates hat to display and flow of interactionView – Defines dow to display information from the View ModelHow does this relate to portable libraries? View – needs to be different per platform. View Model and Model can be the same between platforms.So this pattern is ideally suited for creating cross-platform apps, because it encourages a clean separation between the parts of your code that should be shared and those that are platform specific
  • What besides the UI wasn’t portable? File system, interaction with the OS.The View Models and Models will need that functionality. So…
  • Herewewill créatefirst a base multitargetingappfor wp8 and Windows store apps, and wire in allthenecesarytoworkwith MVVM in a properway.NextwewillimplementanOdataserviceaccestogetherwiththeRepositorypattern, togetherwiththecorresponding ViewModel and Views.
  • UpdateNuGetTolatest versiónInstall-PackagePortable.MvvmLightLibs
  • Therepositoryseparates data consumptionfromhowthe data getspersisted andloaded.OdataClient tolos extendtheaddservicereferencewithclientsideodatasupportfor Windows store and Windows pone apps.
  • Shape 2013 developing multi targeting windows store and windows phone apps

    1. 1. Developing Multi TargettingWin8 & WP8 Apps.Jose Luis LatorreSenior Developer, AccentureUI Lead Developer, Roche - @joslat
    2. 2. The importance of Multi Targeting 5’ABC of Multi Targeting 10’MVVM 5’ AgendaCreating our Multi Targeting App 25’Summarizing + Q & A 5’
    3. 3. The Importance ofMulti TargetingIt is important. that’s why you are here, right?
    4. 4. Windows Phone 8Windows Phone 7.x Direct3D, XAudiWindows Phone .NET o2, MF, WASAPI, Runtime WIN32, COM C#, VB C#, VB, C++ C++
    5. 5. Windows Phone 8 Developer Platform XAML Apps Direct3D Apps In-App XAML Maps Geolocation Sensors Direct3D Purchase HTML XML Threading Touch Speech XAudio2Your apps Phone Features Push Camera Video Proximity Media FoundationYour way Calendar Wallet Contacts Core Types VoIP STL Multitasking Live Tiles Memory Async Enterprise CRT C# and VB C#, VB, and C++ C++ File system, Networking, Graphics, Media Core Operating System
    6. 6. Networking Proximity In-App Purchase Sensors 2,800 Location 11,000 shared File Systemmembers members Core app model Threading
    7. 7. ABC of MultiTargetingLet’s see the main points on how to do it right, the first time.
    8. 8. • Share code across platforms using Portable Class Libraries• Apply MVVM to wire cross-platform apps• Create portable abstractions for non-portable functionality
    9. 9. • Link Source code files between platforms.• Create platform specific Views• Share UI with user controls• Always Decouple! Create Clean & SOLID Code.
    10. 10. portable classlibrary
    11. 11. One SourceOne ProjectOne BinaryMultiple Platforms!
    12. 12. Windows 8 Windows Phone 8
    13. 13. Windows 8 Windows Phone 8
    14. 14. Windows 8#if NETFX_COREDispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {#endifWindows Phone 8#if WINDOWS_PHONEDeployment.Current.Dispatcher.BeginInvoke(() => {#endif
    15. 15. public class ServiceLocator{ public static IFileStorage FileStorage { get; set; } public static IPhotoChooser PhotoChooser { get; set; }}
    16. 16. MVVMIt deserves its own section on this XAML world.
    17. 17. User Interface App LogicGeneral Model-View-ViewModel (MVVM)
    18. 18. Creating our MultiTargeting AppWe will see how to create a Windows Store & Windows PhoneApp that share code and components.
    19. 19. • Usage of PCL to share code• Portable.MvvmLightLibs & Portable.CommonService Locator• MVVM done right• Linking code
    20. 20. • Usage of the Repository pattern• Creation of our first ViewModel• OData Client Tools for Windows Store & Windows Phone Apps (
    21. 21. Do not trust the web…
    22. 22. Summary..So, what have we seen?
    23. 23. Applying best practices is amustUsing proper design patternstooSharing Code through PCL &LinkingMVVM is fundamental
    24. 24. Jose Luis LatorreEmail: joslat@gmail.comTwitter: @joslatBlog: