0
Introduction to Cross Platform
Development with Xamarin/
Visual Studio
Brad Pillow
PillowSoft LLC
Indianapolis Mobile .NET...
Who Am I
• Co-founder of one of the first video-graphics hardware/software companies in
Indianapolis, Truevision Inc. in 19...
Why I Started This Group
• Cross-platform development with .NET is exciting and a lot is happening
• Help evangelize the a...
Visual Studio 2013
• Only works on Windows
• Allows a developer (without extensions) to build only
for Windows (8 and vari...
Typical iOS and Android
Development
• iOS: XCode and Objective-C
• Android: Eclipse and Google SDK
• Good news: free
• Bad...
How Xamarin Works
• Unify app development in C# for all
major device platforms
!
• Deliver fully native apps – UI & 

Perf...
Native UI: No Compromises.
Cross-platform field
service app for iOS,
Android and
Windows 8
*Slide credit:Xamarin, “Xamarin...
Code Sharing Case Study: TouchDraw
Released early Sept 2012 Android – Oct 2012
*Slide credit:Xamarin, “Xamarin 2.0 Overvie...
Tiny Cuts (early) That I Experienced (MonoTouch)
• Initially had issues with value type generics - no reactive extensions
...
Xamarin 2.0 Summary
• Xamarin Studio.  A new IDE that streamlines design, development, debugging and
deployment of native ...
Rich IDE SupportIntroducing Xamarin Studio
Available on Mac and
Windows
Built from the ground up for
cross-platform mobile...
Rich IDE Support
Build iOS, Android and Windows apps in Visual
Studio
100% language unification
across platforms in C#
And...
Pre-built apps
Customize and deploy
!
Cut and paste useful snippets
!
Cross-platform best practices
!
Routing, Time record...
Pre-built apps
Employee Directory
!
Customize and deploy
!
Cut and paste useful
snippets
!
Cross-platform best
practices
!...
Xamarin Component Store• Many components already offer async APIs, e.g. Parse!
Powerful, easy to use components http://com...
Now Bundled with Mono
• Reactive Extensions
– Possible on iOS with new code gen changes
• F# everywhere
• Razor - html tem...
F# Support
• Functional Programming comes to iOS!
!
• The pitch is simple:
– Fewer bugs
– Focus on intent
– Reuse C# libra...
Razor Integration
• Sometimes you want to generate HTML
• Razor offers a full template system
– Blend HTML and C#
– Code c...
New Devices
• Google Glasses (beta)
• Amazon fireTV
• Motorola and others Android watches (beta SDK now)
Xamarin: Per-developer, per platform pricing.
What is the difference between
Starter and Indie?
!
Xamarin Starter allows d...
Rich IDE Support
Xamarin Component Store
High quality pre-built
components – UI controls,
themes & web services
Full IDE i...
MonoDevelop / Xamarin Studio
MonoDevelop Xamarin Studio
MonoDevelop Core MonoDevelop Core
Android Mac iOS
Branding Add-In
...
dtrace probes on MacOS
Major collections and minor collections pause times visualized
http://schani.wordpress.com/2012/11/...
Static Compilation
• For systems that don’t support JITing
– Apple’s iOS devices
– Consoles (PlayStation, Xbox)
– Security...
“Attempting to JIT compile method”
!
!
!
System.ExecutionEngineException: Attempting to JIT compile method
Foo[]:Bar`1
*Sl...
“Attempting to JIT compile method”
!
!
!
System.ExecutionEngineException: Attempting to JIT compile method
Foo[]:Bar`1
FIX...
Build Speed Improvements
Seconds
0
20
40
60
80
Hello World Large App
6.2 6.4
6.4+Incremental
*Slide credit: miguel@gnome.o...
Cocos2D XNA
• XNA port of the popular Cocos2D API
– Over 4,000 games built with this API
– Well documented, well known
!
•...
Using Cocos2D XNA Today
• Available as:
– NuGet Packages
– Templates for VS and Xamarin Studio
!
• Source code:
– http://g...
Angry Ninjas - Full Open Source Game
https://github.com/xamarin/AngryNinjas
*Slide credit: miguel@gnome.org, “What is new ...
Xamarin.Mobile
• Base class library 

for mobile services
!
• Mike Bluestein’s on
Slideshare
*Slide credit: miguel@gnome.o...
Xamarin.Auth
!
• Clients for OAuth 1 and OAuth 2
– Includes variations
• Stores user credentials
• Support non-standard au...
Xamarin.Social
• Posts statuses, links, images/media to social networks
– Access social network APIs using authenticated r...
Now all Open Source
• All frameworks:
– Cocos2D XNA
• http://github.com/mono/cocos2d-xna
– Xamarin.Auth
• http://github.co...
MVVMCross
• The Mvvm Platform for Xamarin.iOS,
Xamarin.Android, WindowsPhone, WindowsStore,
WPF and Mac. Includes databind...
Future topics
• F#: functional programming for mobile development
• Reactive Extensions using reactive programming in mobi...
Why I Use It
• F# allow me to do very rapid development
• Allows me to use F# and C# libs
• PCL’s allow me to write core n...
My Dev Environment
• I use Git for source control
• I use a Mac and run Xamarin Studio on it, as well as Visual Studio on
...
Free T-Shirt!!!!
http://xamarin.com/sharp-shirt
What Next?
• Meet every month?
• Is this day of the week/week of the month good?
• Anyone want to present next?
• What top...
Upcoming SlideShare
Loading in...5
×

Introduction to Cross Platform Development with Xamarin/ Visual Studio

1,409

Published on

Slides from the inaugural meeting for the Indianapolis Mobile .NET Developers Meetup.

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,409
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Introduction to Cross Platform Development with Xamarin/ Visual Studio"

  1. 1. Introduction to Cross Platform Development with Xamarin/ Visual Studio Brad Pillow PillowSoft LLC Indianapolis Mobile .NET Developers Group April 8, 2014
  2. 2. Who Am I • Co-founder of one of the first video-graphics hardware/software companies in Indianapolis, Truevision Inc. in 1987 • My 15 seconds of Wikipedia fame: creator of the TGA file format • Originally developed in C, then we switched to C++ as it matured • Joined Adobe Systems Inc. in 2002 as a developer on Adobe Premiere Pro • Became tired of slow development in C++, left Adobe in 2012 and started my consulting company going again, focusing on .NET C#/F#, web technologies and machine learning
  3. 3. Why I Started This Group • Cross-platform development with .NET is exciting and a lot is happening • Help evangelize the available tools and the languages, in particular F# • Xamarin promotes these meet ups (see freebies) • Looking for a co-organizer • Looking for corporate sponsors • Network with others with similar interests
  4. 4. Visual Studio 2013 • Only works on Windows • Allows a developer (without extensions) to build only for Windows (8 and variants) and Windows Phone 8 • Great debugger • Excellent profiling tools • Fantastic add-ins like ReSharper • Alas, no iOS, Android, no Mac, etc.
  5. 5. Typical iOS and Android Development • iOS: XCode and Objective-C • Android: Eclipse and Google SDK • Good news: free • Bad news: nothing sharable, multiple languages to learn, multiple API’s to learn, etc. • Enter: Xamarin
  6. 6. How Xamarin Works • Unify app development in C# for all major device platforms ! • Deliver fully native apps – UI & 
 Performance ! • Speed time-to-market through
 code-sharing and re-use ! • Businesses can leverage existing C# 
 skills, tools, teams and code ! • Achieve broad reach across device
 platforms and escape the 
 Objective-C and Java dead ends *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  7. 7. Native UI: No Compromises. Cross-platform field service app for iOS, Android and Windows 8 *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  8. 8. Code Sharing Case Study: TouchDraw Released early Sept 2012 Android – Oct 2012 *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  9. 9. Tiny Cuts (early) That I Experienced (MonoTouch) • Initially had issues with value type generics - no reactive extensions • debugging unstable • no F# support • no portable class library support • little refactoring for C# • IDE was unstable and had weird UI issues due to GTK • Amazing how much better tools can get when a company is well funded! Also see: http://jonathanpeppers.com/Blog/xamarin's-tiny-cuts
  10. 10. Xamarin 2.0 Summary • Xamarin Studio.  A new IDE that streamlines design, development, debugging and deployment of native mobile apps.    ! • Xamarin.iOS for Visual Studio.  Visual Studio users can build iOS, Android and Windows apps in their favorite IDE.    ! • The Xamarin Component Store.  An app store for code, where developers add third- party libraries with a few lines of code, and also add beautiful native UI controls and design themes.    ! • Starter Edition.  A free tier that makes it easy for small businesses and individual developers to get started and experience the power of the platform. ! !
  11. 11. Rich IDE SupportIntroducing Xamarin Studio Available on Mac and Windows Built from the ground up for cross-platform mobile development *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  12. 12. Rich IDE Support Build iOS, Android and Windows apps in Visual Studio 100% language unification across platforms in C# And with Xamarin 2.0 100% IDE unification 
 across platforms *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  13. 13. Pre-built apps Customize and deploy ! Cut and paste useful snippets ! Cross-platform best practices ! Routing, Time recording ! Camera capture of work ! Signature capture ! Uses MVVM ! Uses Xamarin.Mobile ! Uses Signature control ! Backend integration ready Field Service App ! *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  14. 14. Pre-built apps Employee Directory ! Customize and deploy ! Cut and paste useful snippets ! Cross-platform best practices !iPhone, Android and Windows ! LDAP-ready ! Gravatar integration ! Uses MVVM ! SQLite data store with a .NET based SQLite ORM on all platforms *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  15. 15. Xamarin Component Store• Many components already offer async APIs, e.g. Parse! Powerful, easy to use components http://components.xamarin.com
  16. 16. Now Bundled with Mono • Reactive Extensions – Possible on iOS with new code gen changes • F# everywhere • Razor - html template engine • Entity Framework • ASP.NET WebStack
  17. 17. F# Support • Functional Programming comes to iOS! ! • The pitch is simple: – Fewer bugs – Focus on intent – Reuse C# libraries, experience – More features, less time
  18. 18. Razor Integration • Sometimes you want to generate HTML • Razor offers a full template system – Blend HTML and C# – Code completion in HTML • Easily pass parameters from C# to Template • “static” pre-rendered templates on iOS
  19. 19. New Devices • Google Glasses (beta) • Amazon fireTV • Motorola and others Android watches (beta SDK now)
  20. 20. Xamarin: Per-developer, per platform pricing. What is the difference between Starter and Indie? ! Xamarin Starter allows developers to build and publish simple apps, which contain no more than 64k of compiled user code (IL), and which do not call out to native third party libraries (i.e., developers may not P/ Invoke into C/C++/Objective-C/Java. See the full product comparison chart. *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  21. 21. Rich IDE Support Xamarin Component Store High quality pre-built components – UI controls, themes & web services Full IDE integration *Slide credit:Xamarin, “Xamarin 2.0 Overview “
  22. 22. MonoDevelop / Xamarin Studio MonoDevelop Xamarin Studio MonoDevelop Core MonoDevelop Core Android Mac iOS Branding Add-In Open source Commercial
  23. 23. dtrace probes on MacOS Major collections and minor collections pause times visualized http://schani.wordpress.com/2012/11/02/sgen-and-dtrace/
  24. 24. Static Compilation • For systems that don’t support JITing – Apple’s iOS devices – Consoles (PlayStation, Xbox) – Security: when not shipping IL ! • Limited generics support – Static analysis limitations – Some dynamisms in .NET idioms • LINQ and Value Types
  25. 25. “Attempting to JIT compile method” ! ! ! System.ExecutionEngineException: Attempting to JIT compile method Foo[]:Bar`1 *Slide credit: miguel@gnome.org, “What is new in Mono? “
  26. 26. “Attempting to JIT compile method” ! ! ! System.ExecutionEngineException: Attempting to JIT compile method Foo[]:Bar`1 FIXED *Slide credit: miguel@gnome.org, “What is new in Mono? “
  27. 27. Build Speed Improvements Seconds 0 20 40 60 80 Hello World Large App 6.2 6.4 6.4+Incremental *Slide credit: miguel@gnome.org, “What is new in Mono? “
  28. 28. Cocos2D XNA • XNA port of the popular Cocos2D API – Over 4,000 games built with this API – Well documented, well known ! • MonoGame brings it everywhere – iOS, Android, Windows Phone (7 and 8) – Mac – Windows (GL, DX, , Windows Store) – Xbox360, Amazon Fire, future Google TV Box – Play Station Mobile (PS Vita + Sony Androids) *Slide credit: miguel@gnome.org, “What is new in Mono? “
  29. 29. Using Cocos2D XNA Today • Available as: – NuGet Packages – Templates for VS and Xamarin Studio ! • Source code: – http://github.com/mono/cocos2d-xna ! • Getting Started: – http://docs.xamarin.com/guides/cross-platform/cocos2d_xna *Slide credit: miguel@gnome.org, “What is new in Mono? “
  30. 30. Angry Ninjas - Full Open Source Game https://github.com/xamarin/AngryNinjas *Slide credit: miguel@gnome.org, “What is new in Mono? “
  31. 31. Xamarin.Mobile • Base class library 
 for mobile services ! • Mike Bluestein’s on Slideshare *Slide credit: miguel@gnome.org, “What is new in Mono? “
  32. 32. Xamarin.Auth ! • Clients for OAuth 1 and OAuth 2 – Includes variations • Stores user credentials • Support non-standard auth schemes • Cross Platform
  33. 33. Xamarin.Social • Posts statuses, links, images/media to social networks – Access social network APIs using authenticated requests. – Automatically and securely store user credentials using Xamarin.Auth. – Cross Platform ! • Extensible, currently has support for: – App.net – Facebook – Flickr – Pinterest – Twitter
  34. 34. Now all Open Source • All frameworks: – Cocos2D XNA • http://github.com/mono/cocos2d-xna – Xamarin.Auth • http://github.com/xamarin/Xamarin.Auth – Xamarin.Mobile • http://github.com/xamarin/Xamarin.Mobile – Xamarin.Social • http://github.com/xamarin/Xamarin.Social ! • Taking patches! *Slide credit: miguel@gnome.org, “What is new in Mono? “
  35. 35. MVVMCross • The Mvvm Platform for Xamarin.iOS, Xamarin.Android, WindowsPhone, WindowsStore, WPF and Mac. Includes databinding support for Android XML, for iOS XIBs and for MonoTouch.Dialog. • http://vimeo.com/68375201 • Keep your models and “view models” as common code, using device specific views per platform. Also provides many abstractions for various platform services.
  36. 36. Future topics • F#: functional programming for mobile development • Reactive Extensions using reactive programming in mobile • Open source .NET libraries for use in mobile dev (JSON.NET, etc.) • MonoTouch.Dialog and MonoDroid.Dialog • Using PCL (Portable Class Libraries) • C#/F# Async Deep dive • MonoGame for easy cross-platform game development • MVVMCross for easier cross-platform app development • Cloud services - Parse, Azure, Firebase…. • Hackathon??
  37. 37. Why I Use It • F# allow me to do very rapid development • Allows me to use F# and C# libs • PCL’s allow me to write core non-UI logic once and share • Rapid turn around time (quick incremental compiles) • Tons of open source libraries • Lots of books and web sites on C#/F# and more on Xamarin every day • With one too I can natively target almost anything out there…even the web
  38. 38. My Dev Environment • I use Git for source control • I use a Mac and run Xamarin Studio on it, as well as Visual Studio on Windows 8 on a VM with Parallels • I try to use on F# and fall back to using open source C# libraries • I have a MacMini server that I use to push my Git commits to (supports a Git server very easily!) • I have the business editions, but will likely drop back to Indie when they are up for renew. They seem to do all I need.
  39. 39. Free T-Shirt!!!! http://xamarin.com/sharp-shirt
  40. 40. What Next? • Meet every month? • Is this day of the week/week of the month good? • Anyone want to present next? • What topics next?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×