How	to	Develop	Cross-platform	apps	with
for	different	kind	of	complex	scenarios
and	any	absurd	client’s	demand
trying	to	stay	focus,
avoiding	losing	your	mind,
meanwhile	your	girlfriend	is	talking	at	you
and	once	again	you	do	not	pay	attention	to	her.
And	don’t	worry,
if you’re reading this,	at the	end,	you’re gonna	be	fine!
How	to	Develop	Cross-platform	apps	with
How	to	Develop	Cross-platform	apps	with
Chi	sono?
[a-zA-Z]
Cosa	è Xamarin?
? ? ?
Ma	come	funziona Xamarin?
Silo	Approach	(o	proprietary	approach)
iOS WindowsAndroid
Objective-C
Xcode
C#
Visual	Studio
Java
Android	Studio
No	shared	code	• Many	languages	&	development	environments	• Multiple	teams
Hybrid	HTML:	Write	Once,	Run	Anywhere
App	Generator
Javascript
HTML+CSS
Limited	native	API	access	• Slow	performance		• Poor	user	experience
Un	esempio:	Cordova
Approccio di	Xamarin (native)
Shared	C#	codebase		• 100%	native	API	access • High	performance
iOS	C#	UI Windows	C#	UIAndroid	C#	UI
Shared	C#	Mobile
Xamarin +	Xamarin.Forms (super-native	J)
• Traditional	Xamarin	Approach • With	Xamarin.Forms:
More	code-sharing,	all	native
iOS	C#	UI Windows	C#	UIAndroid	C#	UI
Shared	C#	Backend
Shared	UI	Code
Shared	C#	Backend
Ma	come	è nata l’architettura di	
Xamarin?
.NET	su Linux,	la	nascita di	Mono
Mono	for	mobile
Bringing	.NET	to	Android
Bringing	.NET	to	Android
Bringing	.NET	to	iOS
Bringing	.NET	to	iOS
Bringing	.NET	to	iOS
Windows	APIs
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%	API	Coverage
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%	API	Coverage
Text-to-speech ActionBar Printing	Framework 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 fare	in	Objective-C,	Swift,	o	Java
puoi farlo con	C#	e	Xamarin.
Strumenti di	sviluppo
Xamarin is	Open	Source!	– open.xamarin.com
Open	Source
• Xamarin.iOS
• Xamarin.Mac
• Xamarin.Android
• Xamarin.Forms
• Bindings	&	Plugins
• Getting	Started
• Contribution	Guides
Xamarin	is	included
in	Visual	Studio!
Visual	Studio	Integration
Xamarin Studio
Visual	Studio	for	Mac
Visual	Studio	iOS	Simulator	Remoting
• Multi-Touch
• Pressure	Sensitive
• Rotate,	screenshots,	
location	changes
• Tutto in	VS
iOS	Designer
Android	Designer
iOS	Build	Process
IDE	&	OS
Architettura di	una applicazione Xamarin
Consigli architetturali
Core	Library
Core	Library	– Shared	Project
Core	Library	– Shared	Project
Core	Library	– Portable	Class	Libraries
Core	Library	– Portable	Class	Libraries
Core	Library	- .NET	Standard	Libraries
M-V-VM	Pattern
M-V-VM	in	Xamarin
M-V-VM	in	Xamarin
Riferimenti DevDay
Xamarin Forms
XAML
Layout	containers
Funzionalità Cross-Platform
Custom	Renderers
La	percentuale di	adozione (e	spesso di	riuscita)	in	un	
progetto di	Xamarin.Forms è inversamente
proporzionale al	numero di	custom	renderers	usati!
tratto dal	libro de	Gli assurdi teoremi di	Turibbio
https://www.xamarin.com/
https://developer.xamarin.com/guides/xamarin-
forms/creating-mobile-apps-xamarin-forms/
DevDay Salerno - Introduzione a Xamarin

DevDay Salerno - Introduzione a Xamarin