Successfully reported this slideshow.

C# rocks

1,767 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

C# rocks

  1. 1. Xamarin C# Rocks. Mobile Rocks.You Rock.
  2. 2. bryan costanich em: bryanc@xamarin.com tw: @bryancostanich slides: slideshare.net/bryancostanich
  3. 3. Sample Code Agent Watch - blog.xamarin.com Tasky - github.com/xamarin/mobilesamples/TaskyPro
  4. 4. DEMO Agent Watch + Xamarin.Android
  5. 5. C# is Everywhere.
  6. 6. Xamarin Platform (The Pitch)
  7. 7. Two Languages, One Framework. .NET Framework + BCL Managed Runtime/Garbage Collection LINQ Lambdas Async/Await + Task Parallel Lib. Compile-Time Checks C F # #
  8. 8. Native Performance Native UX Compiles Down to Native Code, Not Interpreted All Native UX Controls Full Platform SDK Access iOS: Selectors/Obj-C Runtime Android: JNI Fast Enough for Games
  9. 9. Massive Code Reuse Share C# Code Across Platforms C# Libraries Obj-C Bindings + Binding Projects .jar Bindings + Binding Projects C via pInvoke C++ via CPPSharp (github.com/mono/CppSharp)
  10. 10. Component Store Create Sophisticated Applications Quickly High Quality Cross-Platform Components First Class, in-IDE Experience (VS + XS)
  11. 11. Other Platforms Windows - via .NET Mac - via Xamarin.Mac Linux - via Mono Ouya, XBOX, PSP, etc. Etc.
  12. 12. Xamarin + C# Community is Awesome Huge C# Community StackOverflow.com forums.xamarin.com IRC + chat.xamarin.com Great Support
  13. 13. Amazing IDEs Visual Studio or Xamarin Studio Android + iOS Designer Debugging, Autocomplete, Refactoring Integrated Source Control
  14. 14. Component Store Tons of Components Cross-Platform IDE-Integration - drop-in! Revenue Model for User Submitted
  15. 15. Xamarin is Awesome.
  16. 16. Building Xplat Mobile Apps
  17. 17. General Xplat Considerations
  18. 18. Design PlatformSpecific UX UX in iOS != Android != Windows Phone UX Metaphors are Different: Navigation Controller vs. Back Button Write-Once, Run-Anywhere is Problematic Users Expect Native UX
  19. 19. Choose Device Targets iPhone != iPad Beware Android Fragmentation Form Factor + Capability Differences Inform UX Pro-Tip: Minimize Targets
  20. 20. Test on All Targeted Devices! Device != Emulator/Simulator Xamarin Test Cloud Hundreds of Actual Devices Integrates into your CI Workflow
  21. 21. Xplat Architectural Recommendations
  22. 22. Architecture Good Architecture == Good Architecture Layers Separation of Responsibility Encapsulation Enables Core Code Sharing
  23. 23. Code Sharing PCL vs. File Linking PCL Libraries - Great for Components File Linking - Better for Apps PLP - Take a Lot of Architectural Work, Linking is Easy Our Recommendation: File Linking for Projects Both VS and XS have Project Linker Add-ins
  24. 24. Project Setup New Blank Solution: "[AppName]" New C# Lib Project: "[AppName].Core" Test Project: “[AppName].Core.Tests” New Xamarin.iOS: “[AppName].iOS” New Xamarin.Android: “[AppName].Droid” New Windows Project "[AppName].WinStore"
  25. 25. Demo Creating a Cross Platform Mobile Solution
  26. 26. Shared Data + Data Access Layer SQLite on iOS + Android, C# SQLIte on Windows Market Apps: http://code.google.com/p/csharp-sqlite/ SQLite.NET ORM Use Generics for CRUD Convenience Methods: TaskDatabase.cs
  27. 27. Platform Divergence Handling Divergence + Taking Advantage of Platform Features
  28. 28. Conditional Compilation Pre-Defined Symbols: #if __MOBILE__ #if __ANDROID__ #if __IOS__ #if WINDOWS_PHONE #if SILVERLIGHT Can Add Additional in Build Settings
  29. 29. Architectural Abstraction Different Implementation using Architecture Interfaces IoC/Provider Pattern
  30. 30. Xamarin.* Libraries XPlat API Abstractions Open Source Github.com/Xamarin/Xamarin.* Mobile Social Auth
  31. 31. Other Xplat Libs MonoCross http://code.google.com/p/monocross/ MvvmCross https://github.com/slodge/MvvmCross Vernacular - https://github.com/rdio/vernacular MonoGame - http://monogame.net Cocos2D - http://cocos2DXNA.net Many, many, many more!!!
  32. 32. Get Building. :)
  33. 33. Q+A

×