The Year of .Forms

Aleksander Piotrowski @pelotasplus Agenda

1. What platform needs … to be a rockstar platform 2. And then ... happened 3. What’s the difference between Xamarin and Xamarin.Forms 4. What Xamarin.Forms … cannot do (easily) 5. What Xamarin.Forms … can do 6. Apps using Xamarin(.Forms) What platform needs … to be a rockstar platform Programing Language IDE /podcasts Jake Wharton Visionary Documentation Testing tools/services Emulator

Events Third-party components Library Programing Language

C# F# XAML IDE IDE Jake Wharton

● Paul Betts ○ ModernHttpClient ○ refit ○ OkHttp for Xamarin ● James Montemagno ○ MeetupManager ○ Connectivity Plugin for Xamarin ■ ~340k downloads ○ podcasts, posts, youtube videos Blogs/podcasts

● Fragmented Merge Conflict ● Android Developers Backstage Xamarin Podcast ● ● .NET rocks! ● Xamarin University paid ● blog.xamarin.com ● hardcore .Net fans also blogging about Xamarin Visionary

● never received a degree ● developer since 1992 ● ● early contributor ● worked on Sun SPARC ● later on Linux for SGI Indy ● almost ported to SPARC ● started GNOME project and created Gnumeric ● started project to implement .NET on Linux ● Xamarin so Mono on mobile* ● Microsoft, Visual Studio for Mac, reboot mobile for Microsoft Documentation

● for all targeted platforms ● Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Xamarin.everything ● Android developer could learn iOS app architecture ● explains not only C# or Xamarin-related aspects but also of all the platforms ● https://developer.xamarin.com/guides/android/user_interface/ ● https://developer.xamarin.com/guides/ios/user_interface/introduction_to_storyboards/ ○ 27 pages long PDF ○ detailed description of what Storyboards really are Emulator

● Xamarin Android Player ● Visual Studio Emulator for Android ○ more or less Genymotion equivalent ● Remoted iOS Simulator ○ for Windows ○ for Visual Studio ○ enterprise edition ○ a Mac is needed for that Testing tools/services

● JUnit NUnit ● Calabash ● UITest for Xamarin ○ Xamarin Test Recorder ● run on thousands of real devices w/ Xamarin Test Cloud ● with Visual Studio Mobile Center also available for !Xamarin apps ○ Espresso ○ Appium ○ coming soon UWP source: https://xamarin.com/test-cloud Events

I/O Xamarin Evolve ○ and yes, it’s expensive ● Microsoft Connect ○ all things Microsoft ○ with Xamarin on a prominent place ● lot’s of local meetups all the time ○ Xamarin Dev Days ○ .NET (junior) meetups Third-party components Library

● Json.NET - GSON for all platforms ○ 54,831,282 total downloads ○ 23,902 avg downloads / day Third-party components Library RESTful API ● Json.NET - GSON for all platforms ● refit - retrofit for all platforms ○ Xamarin.Android AFNetworking OkHttp ○ Xamarin.Mac ○ Xamarin.iOS 64-bit (Unified API) network service ○ Desktop .NET 4.5 in our app ○ Windows Store 8.1+

○ Windows Phone 8.1 Universal Apps manually Gson as a dict ○ .NET Core

data model Third-party components Library

● Json.NET - GSON for all platforms ● refit - retrofit for all platforms ● SVProgressHUD ○ 9,564 stars ○ 2,079 forks Third-party components Library

● Json.NET - GSON for all platforms ● refit - retrofit for all platforms ● SVProgressHUD ● everything is available from Android or iOS worlds Third-party components Library

● Json.NET - GSON for all platforms ● refit - retrofit for all platforms ● SVProgressHUD ● everything is available from Android or iOS worlds ● Components for Xamarin ○ Android Support Libraries ○ SDK ● Plugins for Xamarin ○ Battery Status ○ Connectivity - 369,811 downloads ● 6 different parse.com bindings Programing Language IDE Blogs/podcasts Jake Wharton Visionary Documentation Testing tools/services Emulator

Events Third-party components Library And then … Microsoft happend

And then … Microsoft happend

1. not making it Windows-only! ○ Windows ■ IDEs ■ all .NET ■ Xamarin ○ Mac ■ IDEs ■ .NET core ■ Xamarin ○ Linux ■ some IDEs ■ .NET core ■ Xamarin And then … Microsoft happend

1. not making it Windows-only! 2. for Mac ○ premier developer product ○ based on Xamarin Studio, so… ○ … 100% mac look and feel ○ not all “workloads” supported though And then … Microsoft happend

1. not making it Windows-only! 2. Visual Studio Code for Mac 3. making it free* ○ for small companies, or ○ devs working for small companies ○ not only Xamarin but also Visual Studio community edition And then … Microsoft happend

1. not making it Windows-only! 2. Visual Studio Code for Mac 3. making it free* 4. going open-source ○ all code on GitHub ○ not dumped there from time to time, but ○ developed in public ○ feature branches, PRs, issues ○ soon nightly builds from feature branches or PRs And then … Microsoft happend

1. not making it Windows-only! 2. Visual Studio Code for Mac 3. making it free* 4. going open-source 5. clear vision ○ public roadmap ■ macOS supported in Xamarin.Forms 2.5.0 to be released Q3 2017 ○ Xamarin.Forms Evolution ■ a forum ■ discuss new features ■ ends up with rejection, or … ■ … someone from Microsoft or community implements particular feature! https://github.com/xamarin/Xamarin.Forms/pull/746 What’s the difference between Xamarin and Xamarin.Forms Application layer (platform specific) layer

Service access layer Service access layer (REST) (JSON)

Business Logic Business Logic (data model) (itself)

Data layer (SQLite) Data access layer (CRUD) “With language advantages of C# and run-time advantages one can even create applications that are faster than apps created in native languages” - Chris Van Wyk, Xamarin University mobile expert

“Xamarin leverages JIT compilation, just Android application, to create optimized executable on executing device” - Judy McNeil, Xamarin University mobile expert

Fat binary vs slim debug build ● Hello world + Base Class Library: 15.8MB

● Hello world + BCL after Linking: 2.9MB

● Linking results in a package that is 30% the size of the original source: used to be here http://developer.xamarin.com/guides/android/advanced_topics/linking/ Application layer (platform specific) User interface layer

Service access layer Service access layer (REST) (JSON)

Business Logic Business Logic (data model) (itself)

Data layer (SQLite) Data access layer (CRUD) Application layer (platform specific) User interface layer (platform specific)

Xamarin.Forms Xamarin.Forms

Service access layer Service access layer (REST) (JSON)

Business Logic Business Logic (data model) (itself)

Data layer (SQLite) Data access layer (CRUD) What Xamarin.Forms … can do

1. Multiplatform

● iOS ● Android ● Windows ○ Windows Phone 8.X ○ UWP (Windows 10) ● Tizen ○ Samsung phones ○ and TVs ● Mac ○ Q3 2017, now in beta 2. Rich set of predefined UI elements

● Pages ● Layouts ● Controls ● … all mapped at run-time to platform-specific native UI elements source: https://xamarin.com/forms source: https://xamarin.com/forms 3. Create UI in XAML