59
How to Develop Cross-platform apps with

DevDay Salerno - Introduzione a Xamarin

Embed Size (px)

Citation preview

HowtoDevelopCross-platformappswith

fordifferentkindofcomplexscenariosandanyabsurdclient’sdemand

tryingtostayfocus,avoidinglosingyourmind,

meanwhileyourgirlfriendistalkingatyouandonceagainyoudonotpayattentiontoher.

Anddon’tworry,if you’re reading this,at theend,you’re gonnabefine!

HowtoDevelopCross-platformappswith

HowtoDevelopCross-platformappswith

Chisono?

[a-zA-Z]

Cosaè Xamarin?

? ? ?Macomefunziona Xamarin?

SiloApproach(oproprietaryapproach)

iOS WindowsAndroid

Objective-CXcode

C#VisualStudio

JavaAndroidStudio

Nosharedcode• Manylanguages&developmentenvironments• Multipleteams

HybridHTML:WriteOnce,RunAnywhere

AppGenerator

JavascriptHTML+CSS

LimitednativeAPIaccess• Slowperformance• Pooruserexperience

Unesempio:Cordova

Approccio diXamarin (native)

SharedC#codebase• 100%nativeAPIaccess • Highperformance

iOSC#UI WindowsC#UIAndroidC#UI

SharedC#Mobile

Xamarin +Xamarin.Forms (super-nativeJ)

• TraditionalXamarinApproach • WithXamarin.Forms:Morecode-sharing,allnative

iOSC#UI WindowsC#UIAndroidC#UI

SharedC#Backend

SharedUICode

SharedC#Backend

Macomeè nata l’architettura diXamarin?

.NETsu Linux,lanascita diMono

Monoformobile

Bringing.NETtoAndroid

Bringing.NETtoAndroid

Bringing.NETtoiOS

Bringing.NETtoiOS

Bringing.NETtoiOS

WindowsAPIs

Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

iOS– 100%APICoverage

MapKit UIKit iBeacon CoreGraphics CoreMotion

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Android– 100%APICoverage

Text-to-speech ActionBar PrintingFramework Renderscript NFC

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Tutto ciò che puoi fareinObjective-C,Swift,oJavapuoi farlo conC#eXamarin.

Strumenti disviluppo

Xamarin isOpenSource!– open.xamarin.com

OpenSource

• Xamarin.iOS• Xamarin.Mac• Xamarin.Android• Xamarin.Forms• Bindings&Plugins

• GettingStarted• ContributionGuides

XamarinisincludedinVisualStudio!

VisualStudioIntegration

Xamarin Studio

VisualStudioforMac

VisualStudioiOSSimulatorRemoting

• Multi-Touch• PressureSensitive• Rotate,screenshots,locationchanges• Tutto inVS

iOSDesigner

AndroidDesigner

iOSBuildProcess

IDE&OS

Architettura diuna applicazione Xamarin

Consigli architetturali

CoreLibrary

CoreLibrary– SharedProject

CoreLibrary– SharedProject

CoreLibrary– PortableClassLibraries

CoreLibrary– PortableClassLibraries

CoreLibrary- .NETStandardLibraries

M-V-VMPattern

M-V-VMinXamarin

M-V-VMinXamarin

Riferimenti DevDay

Xamarin Forms

XAML

Layoutcontainers

Funzionalità Cross-Platform

CustomRenderers

Lapercentuale diadozione (espesso diriuscita)inunprogetto diXamarin.Forms è inversamente

proporzionale alnumero dicustomrenderersusati!tratto dallibro deGli assurdi teoremi diTuribbio

https://www.xamarin.com/

https://developer.xamarin.com/guides/xamarin-forms/creating-mobile-apps-xamarin-forms/