Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Développement cross-plateforme sans compromis avec Xamarin

1,039 views

Published on

Après une rapide introduction à Xamarin, l’outil de création d’applications multi plateformes natives en C#, nous verrons comment (ré)organiser une application pour partager un maximum de code entre les plateformes. Nous exposerons les différentes possibilités et mettrons l’accent sur Xamarin.Forms, allant jusqu’à créer nos propres composants visuels.

Published in: Technology
  • Be the first to comment

Développement cross-plateforme sans compromis avec Xamarin

  1. 1. #XamarinFR 1
  2. 2. @micjames6 mike@xamarin.com micjames.co.uk Mike James Developer Evangelist, Xamarin Inc Twitter Email Web
  3. 3. The best language for Windows development. Modern Features • Advanced Tools • Proven Libraries • Large Community • Statically Typed #
  4. 4. Xamarin makes C# the best language for mobile development. Native Code Generation • Platform API Bindings • Code Sharing • Visual Studio +#
  5. 5. Xamarin ‘embraced and extended’ .NET
  6. 6. Architecting Mobile Apps
  7. 7. Silo Approach Build Apps Multiple Times
  8. 8. Write Once, Run Anywhere Approach Lowest Common Denominator
  9. 9. Xamarin’s Unique Approach Native With Code Sharing
  10. 10. Windows APIs
  11. 11. iOS APIs | 100% Coverage
  12. 12. Android APIs | 100% Coverage
  13. 13. Anything you can do in Objective-C, Swift, or Java can be done in C# with Xamarin using Visual Studio
  14. 14. C# runs on 2.6 Billion Devices
  15. 15. How Xamarin Works  C# + .NET Runtime  Native UI  Native Performance
  16. 16. Portable Class Libraries
  17. 17. Xamarin.Forms With Xamarin.Forms: more code-sharing, native controls Traditional Xamarin approach Shared UI Code
  18. 18. Xamarin.Forms Quickly and easily build native user interfaces using shared code Xamarin.Forms elements map to native controls and behaviours Mix-and-match Xamarin.Forms with native APIs Shared UI Code
  19. 19. What’s Included  40+ Pages, Layouts, and Controls  Build from code behind or XAML  Two-way Data Binding  Navigation  Animation API  Dependency Service  Messaging Center Shared UI Code
  20. 20. Pages Content MasterDetail Navigation Tabbed Carousel
  21. 21. Layouts Stack Absolute Relative Grid ContentView ScrollView Frame
  22. 22. Controls ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell
  23. 23. • Not for all types of apps • Is your app very customised? • Great for data driven apps • Utility apps • Also supports maps Considerations
  24. 24. 24 Platform-specific projects act as "host" to create native application Portable Class Library or Shared Project used to hold shared code that defines UI and logic Project Structure
  25. 25. Pages • Single screen of content • ContentPage holds one visual element ContentPage Control Content property
  26. 26. Layouts • Layouts handle child elements • Layouts come in two types: managed and unmanaged ContentPage Layout Content property Control Control Children Control
  27. 27. Demo - Creating User Interfaces
  28. 28. 28 Providing Behaviour var entry = new Entry { Placeholder = "Enter text", Keyboard = Keyboard.Email }; entry.TextChanged += (sender, e) => { // Input changed }; Controls expose properties to alter visualisation Controls expose events to provide interactive behaviour
  29. 29. Demo - Adding Behaviour
  30. 30. 30 Model-View-ViewModel ModelView ViewModel How to display information What to display Flow of interaction Business Logic Data objects Events Data Data
  31. 31. 31 Model-View-ViewModel ModelView ViewModel Xamarin.Forms Data Binding Events Data
  32. 32. 32 Data Binding
  33. 33. 33 Data Binding
  34. 34. 34 Data Binding
  35. 35. 35 Data Binding
  36. 36. Demo - Stocks
  37. 37. 38 Extensibility • Custom Renderer • Easily subclass any control you wish to customize • Add your own custom controls • Add custom bindable properties http://developer.xamarin.com/guides/cross- platform/xamarin-forms/custom-renderer/
  38. 38. 39 Extensibility Standard Entry Control
  39. 39. 40 Extensibility Step 1: Custom Xamarin.Forms Control
  40. 40. 41 Extensibility Step 2: Use Custom Control in Shared Pages
  41. 41. 42 Extensibility Step 3: Implement Custom Renderer
  42. 42. 43 Extensibility Step 4: Export Renderer
  43. 43. 44 Extensibility Dependency Service Allows shared code to access platform-specific SDK features via an Interface Implementation
  44. 44. 45 Summary • Cross platform apps the easy way • Powerful layout functionality • Many built in controls • Extensible
  45. 45. 46 Charles Petzold Xamarin Read the book
  46. 46. Learn more Unrivalled Mobile Development Training Live unlimited mobile development training from mobile experts, in your time-zone, on your schedule and as often as you'd like xamarin.com/university
  47. 47. Get Started Today: xamarin.com/download

×