e-zuka tech night vol.29 - cross platform mobile apps with xamarin

17
Cross platform mobile apps with Xamarin Simone Basso Head of Engineering @justeat_tech @ smnbss

Upload: simone-basso

Post on 24-Jul-2015

264 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Cross platform mobile apps with

XamarinSimone BassoHead of Engineering @justeat_tech@smnbss

Page 2: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Who am ISimone BassoHead of Engineering @justeat_techhttp://smnbss.com/@smnbss

Page 3: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Questions:- How many of you are mobile developers?

- How many of you are Cross Platform mobile developers?

Page 4: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

How do I know about mobileIn 2011 some friends on mine won the Italian 'Global Game Jam' (GGJ), with a game called “Smashing Planets” developed using Microsoft XNA for the PC.Back then I was one of the few people owning a Windows Phone and an XBOX, so I asked them for the source code and I made the first port to XBOX and Windows Phone.Then I got excited and discovered a project called MonoGame, that is an Open Source implementation of Microsoft XNA.In a matter of a few weeks we were able to port the game to Android and iOS http://bit.ly/android_smashing, http://bit.ly/apple_smashinghttp://bit.ly/windows_smashing

Page 5: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

What is MonoGameMonoGame (http://www.monogame.net/) is a cross platform “Write once, play everywhere” (iOS, Android, MacOS, Linux, Windows, Windows Store, Windows Phone, and PlayStation 4) framework built on top of Xamarin.It allows you to write a game once and get it to work pretty much everywhere.FEZ (http://fezgame.com/) is probably the most famous game writtenwith MonoGame

Start

Calculate Element Position

Render Elements

Page 6: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

What is XamarinXamarin is a company based in San Francisco, born as a spin off from Novell when Novel decided not to support Mono anymore.Xamarin.iOS and Xamarin.Android are a Cross Platform implementation of the .NET Framework based on Mono.It’s the only framework that allows you to write NATIVE cross platform mobile apps using the same language and sharing up to 100%* of the code.Microsoft recently open sourced (https://github.com/Microsoft/dotnet) all the core components of .NET and created the .NET Foundation, and made Xamarin life a lot easier, as there’ll be more and more support for running .NET on Unix based operative systems (OSX / Linux) and mobile operative systems (iOS / Android).

* Only with Xamarin.Forms

Page 7: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

What can you build with XamarinAnything. Really.- Google Watch- Apple Watch- Rich UI appsAnything you can do in ObjectiveC for iOS, Java for Android and C# for Windows (Phone, Tablets etc come out of the box with .NET) you can do it with Xamarin.

Page 8: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Xamarin Architecture

Page 9: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Xamarin ArchitectureMVVM is the recommended pattern when building X Platform mobile apps.It allows to decouple the UI (View) from the Business Logic (Model/ViewModel).MVVM is the pattern used by Angular JS when you use 2-way binding.It’s probably the only good thing left after the death of Silverlight

Page 10: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Is it really Native in iOS?Yes C# is compiled to CIL (common intermediate language), and then (since Xamarin.iOS 4.0) transcompiled to LLVM.Xamarin is basically as fast as Swift 1.2* and almost 3 times faster than Swift 1.1, using a similar amount of memory

* https://medium.com/@harrycheung/cross-platform-mobile-performance-testing-d0454f5cd4e9

Page 11: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Is it really Native in AndroidKind of , but it’s even better.C# is compiled to CIL (common intermediate language), and then run on a MonoVM on Android.It does not touch the DalvikVM unless it’s calling some native libraryXamarin is basically as fast as Java * and using a very similar amount of memory

* https://medium.com/@harrycheung/cross-platform-mobile-performance-testing-d0454f5cd4e9

Page 12: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Xamarin.FormsIf all you want to build is a very simple data driven app, you now have a new option.It’s called Xamarin.Forms.You can build your UI once, using XAML (the eXtensible Application Markup Language) and Xamarin.Forms will take care of rendering it with a native look and feel on every platform.You can still override how every component is rendered and how they behave on each platform using OnPlatform and custom renderers.You can reach 100% code reusability for very simple apps.Ideal for prototyping.

Page 13: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

Xamarin vs Xamarin.Forms

Page 14: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

I want to see some codeGo to http://propertycross.com/ and https://github.com/tastejs/PropertyCross/, this is the most comprehensive comparison of cross platform mobile framework.

Or go and checkout this repohttps://github.com/jamesmontemagno/Hanselman.Forms.James is one of the top Xamarin Evangelist and has built a sample app to showcase all the best Xamarin.Forms practices.

Page 15: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

What Else - Xamarin Test CloudBuilt on Calabash, you can test your app on hundreds of REAL devices with a click of a button.

You can use this, NOW, even if you are building Native apps without using Xamarin.

Page 16: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

What Else - Xamarin InsightComprehensive Crash Reports and Analytics for your App.Step by step tracking of user activity.

Page 17: e-ZUKA Tech Night vol.29 - Cross platform mobile apps with Xamarin

The EndThis was a very high level overview of how you can use Xamarin and all of their products to build,

test and support cross platform native apps.

Any question?

Simone BassoHead of Engineering @justeat_techhttp://smnbss.com/@smnbss