Cross platform development with c# and xamarin
-
Upload
luca-zulian -
Category
Engineering
-
view
524 -
download
1
Transcript of Cross platform development with c# and xamarin
![Page 1: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/1.jpg)
28 ottobre 2013Bologna
![Page 2: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/2.jpg)
#mobc2013
![Page 3: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/3.jpg)
CROSS-PLATFORM DEVELOPMENT WITH C# AND XAMARINLuca Zulian
CR02
Dev4Side S.r.l, Developer
Giuseppe MarchiDev4Side S.r.l., CoFounder, Ceo
![Page 4: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/4.jpg)
Chi sono
• Fondatore di Dev4Side S.r.l.• Microsoft MVP su SharePoint da 3 anni• Speaker per eventi Microsoft ed eventi Community in Italia• MCP, MCPD Web applications, MCTS ASP.NET 4, WSS 3.0, MOSS
2007 e SharePoint 2010• SharePointer dal lontano 2005• Padre di www.peppedotnet.it • Autore del libro «Pocket C#» edito da Apogeo• Membro attivo, speaker e promotore di SharePointCommunity.it• Il primo in Italia ad aver messo un’App sull’Office Store• Uno dei TOP 25 SharePoint Influencers in Europa
![Page 5: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/5.jpg)
Chi sono
• Developer e Architect in Dev4Side S.r.l.
• MCTS Web Application ASP.NET 4
![Page 6: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/6.jpg)
Agenda
• Overview on mobile platforms and development• Xamarin Approach and Architecture
• Cross-Platform development with Xamarin
![Page 7: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/7.jpg)
OVERVIEW ON MOBILE PLATFORM Rapid overview on mobile platform
![Page 8: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/8.jpg)
Over 2.6 billion of mobile devices
By 2016, 70% of the mobile workforce will have a smartphone, and 90% of enterprises will have two or more platforms to support
![Page 9: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/9.jpg)
Some statistics…
![Page 10: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/10.jpg)
Write Apps Three Times – Native Approach
![Page 11: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/11.jpg)
Development on iOS • Mac OS X • XCode • Objective-C• iOS SDK• Apple Tools
Development on Android
Development on Windows Phone
• OS indipendent • Eclipse, IntelliJ IDEA or Android Studio or…• Java• Android SDK• SDK Tools
• Windows OS• Visual Studio • C#• .NET Framework• Windows Phone SDK
![Page 12: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/12.jpg)
I am going crazy
![Page 13: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/13.jpg)
The answer?
![Page 14: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/14.jpg)
Ok I have the answer
![Page 15: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/15.jpg)
Write Once, run Anywhere?
UX in Android != iOS != Windows Phone
![Page 16: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/16.jpg)
Ipse dixit: Martin Fowler
• Don’t use cross platform toolkits• UI Translation leads to fatal compromises in
user-experience • Build a native app for that platform, with a
experience design based on that platforms interaction style
(link here: http://martinfowler.com/bliki/CrossPlatformMobile.html)
![Page 17: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/17.jpg)
Why Xamarin? (part 1)
![Page 18: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/18.jpg)
Why Xamarin? (part 2)
• Your C# apps on 2.6 billion devices.• Amazing IDE (Available on Windows and Mac)• Integrated with Microsoft (Visual Studio)• Always up-to-date• Finish your app faster (With a library of pre-built
components)• Complete Documentation• Training and Support• Over 400.000 Developers in the World
![Page 19: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/19.jpg)
XAMARIN APPROACH AND ARCHITECTURE
![Page 20: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/20.jpg)
Xamarin Architecture
• Layers• Separation of Responsibility• Encapsulation• Code Core Sharing
![Page 21: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/21.jpg)
Benefits
• Accelerate time to market• Start now with existing team• C# and .NET are mature and powerful• Usage of C# feature (async, LINQ, generics etc.)• Skill reuse on all platform• Engaging, native experience• Code can be reused across platforms (even non-
mobile platform!)• Integrate with existing enterprise architecture
![Page 22: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/22.jpg)
Xamarin App – Compile and Run
APPS ARE STILL COMPLETELY NATIVE!!!
![Page 23: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/23.jpg)
Xamarin Studio IDE
• FEATURES• Unified Search• Find and Replace• Code Navigation• Code Completion• Debugger• Breakpoints• Watches• Refactoring
Support• Source Control
![Page 24: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/24.jpg)
Xamarin Visual Designer
• Immagine delle schermate di MyTasks con vs e xamarin studio
![Page 25: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/25.jpg)
DEMO
![Page 26: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/26.jpg)
CROSS-PLATFORM DEVELOPMENT WITH XAMARIN
![Page 27: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/27.jpg)
Setting Up A Xamarin Cross Platform Solution (part 1)• Code sharing
• File Linking into each App Project• File Linking to Separate Projects• Clone Project Files
• Populating the Solution• Core project - Write re-usable code in one place,• Platform-specific application projects - Platform-specific features are added at this level
• Project References
• Adding Files
![Page 28: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/28.jpg)
Setting Up A Xamarin Cross Platform Solution (part 2)• Handling Platform Divergence & Features
• Platform Abstraction
• Identify fundamental elements that exist across platforms• Platform-specific attributes• Device-specific features• PreProcessor directives
• Separate common logic from UI (Interfaces, Inheritance, Base Classes etc)• MonoTouch.Dialog and MonoDroid.Dialog• Xamarin.Mobile
• Divergent Implementation• Conditional Compilation
• Xamarin.* Libraries & Components
• MonoCross Framework (https://code.google.com/p/monocross/)
![Page 29: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/29.jpg)
DEMO
![Page 30: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/30.jpg)
What I need to use Xamarin?
• Xamarin development can be done in either Xamarin Studio or Visual Studio. The IDE you choose will be determined by the platforms you wish to target.
• Because Windows Phone apps can only be developed on Windows, it is impossible to develop for all three platforms on the same operating system.
![Page 31: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/31.jpg)
Pricing• Mono is an open source project. The Mono virtual machine is licensed under the LGPLv2 license
Permitted UseDeploy to DeviceDeploy to App StoresXamarin StudioUnlimited App SizeVisual Studio SupportBusiness FeaturesPrime ComponentsEmail SupportOne Business Day SLAHotfixesTechnical Kick-off SessionCode Troubleshooting
![Page 32: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/32.jpg)
Resources to Start
• Last Xamarin Conference (http://xamarin.com/evolve/2013)
• Stack Overflow / Mailing List• Xamarin samples (http://docs.xamarin.com/samples-all)• Xamarin forum (http://forums.xamarin.com/)• GitHub (https://github.com/xamarin)• Books
![Page 33: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/33.jpg)
QUESTIONS&
ANSWERS
![Page 34: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/34.jpg)
Links
• Technical Conferenceswww.technicalconferences.it
• Mobile Conferencewww.mobileconference.it
• Dev4Sidewww.dev4side.com
• PeppeDotNetwww.peppedotnet.it
• Queubewww.queube.com
![Page 35: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/35.jpg)
Grazie.Non dimenticare di riempire il modulo di feedback
CR02
![Page 36: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/36.jpg)
#mobc2013
![Page 37: Cross platform development with c# and xamarin](https://reader031.fdocuments.in/reader031/viewer/2022021919/5878ba761a28ab724c8b75ab/html5/thumbnails/37.jpg)
© EventHandler S.r.l. All rights reserved. Microsoft, Windows and all other trademarks and copyrights are the property of their respective owners. EventHandler cannot guarantee the accuracy of any information provided after the date of this presentation. EVENTHANDLER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.