Building iOS applications with Xamarin and C#

  • Published on
    14-Apr-2017

  • View
    328

  • Download
    4

Embed Size (px)

Transcript

PowerPoint Presentation

Building iOS applications with Xamarin and C#

Microsoft and Xamarin MVP@Tinytoot | www.tomwalker.codesTom Walker

Xamarin Introduction! 1

Meet Tom Walker | @TinytootFounder @LdnOntNetDevs | LondonNetDevelopers.caWindows Platform DevelopmentMVP Xamarin MVPDeveloper for 15+ years now focusing on mobile and web frontend Worked with large enterprises, startups and software companiesDesign & build internal enterprise and consumer facing software

2

ObjectivesDefine the ProblemHow Xamarin WorksDevelopment EnvironmentiOS Application Life CycleDemo - Bing Images

Define the Problem

Silo ApproachBuild Apps Multiple TimesMultiple TeamsMultiple Code BasesDifferent toolsets

Multiple TeamsMultiple Code BasesExpensive & SlowPositive = Great apps delivered to users platformNegative = Development hampered by multiple code bases & fragmentation5

Xamarins Unique ApproachNative User InterfaceNative PerformanceShared code across platformsC# & .NET FrameworkFull API Coverage

UI build natively per platform, leveraging C#C# + XAMLC# + XMLC# + XIBOne shared app logic code base, iOS, Android, Mac, Windows Phone, Windows Store, Windows6

How Xamarin Works

Xamarin.iOS does full Ahead Of Time (AOT) compilation to produce an ARM binary for Apples App Store.Native PerformanceXamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device.

There is no compromise on performance.Xamarin apps look and feel native because they are native.8

.NET + Windows APIs

If you have ever developed for a Windows Platform before these .NET namespaces might look familiar.

However, if we go to a new platform such as Windows Phone or Store we have a new SDK to use and a new set of namespaces.

9

.NET + iOS APIs | 100% Coverage

You can think of iOS and Android development the same with Xamarin. You can see we have all of our .NET namespaces and libraries, but Xamarin give us 100% api coverage of each iOS API in its SDK that we access view C#.10

Always Up-to-Date

Track record of offering same-day support:iOS 5, iOS 6, iOS 7, iOS 7.1, iOS 8

Full support for:Google GlassAndroid WearAmazon Fire TVMore!

Apple has a developer preview where Xamarin has alphas ready. Google does not offer this. Android versions are usually 4 to 8 weeks out for a stable release, but alphas and betas are usually earlier. Xamarin realizes how important having iOS ready because within 24 hours a large portion of iOS users upgradeAndroid on the other hand is much different. After 4 months on the market Android 4.4 only had 1% adoption11

Distribute EverywhereA Xamarin app can be distributed everywhere

Compiles down to APK or IPA that you can distribute anywhere, any store.Or even internal enterprise12

Xamarin StudioPC or MacVisual Studio PluginVS 2010 and HigherDevelopment Environment

Xamarin StudioPC -> AndroidMac -> iOS, Android, MacVisual Studio: iOS, Android Windows13

Create native iOS, Android, Mac andWindows apps in Visual Studio and C#

14

Visual Studio IntegrationA single solution:iOSAndroidWindows PhoneWindows Store

Leverage the entire Microsoft ecosystem:ReSharperTeam Foundation ServerYour favorite code coverage and profiling tools

Additionally Supports Visual Studio 2010, 2012, & of course 2013Additionally support desktop apps on Windows: WPF, ASP.NET, Silverlight, WinForms!The same Solution & Projects open in BOTH Xamarin Studio and Visual Studio!

15

16

Visual Studio IntegrationDebug to:EmulatorsDevices

Integrated into toolbarStatusLogsList of devices

Just Click Start Debugging!

Connect to Mac build host for iOS developmentShow list of all iOS devices and Simulators to debug onShows all Android devices and emulatorsX86, Arm, Genymotion..Take advantage of all debugging power of VS17

Xamarin Designer for iOSWorlds first iOS Designer available in Xamarin Studio and Visual Studio

Follows familiar Visual Studio designer idioms

Supports all UIKit elements

Edit custom and 3rd party components

Live preview of changes to properties

18

iOS App Settings

Xamarin Component StoreBuild Apps Faster

Add high quality pre-built app components directly from Visual Studio and Xamarin Studio

Beautiful cross-platform UI controls, cloud services and enterprise backend integrations are just a few clicks away

Add high quality pre-built app components directly from Visual Studio.

Includes dozens of beautiful UI controls and web services adding a theme or a 3rd party library is just a few clicks away

Complements existing .NET NuGet ecosystem

Differentiator: focus on UI controls and themes we are making developers better designers across all platforms

20

iOS Application Lifecycle & Structure

Lets talk a bit about C# and why it is awesome.21

BackgroundForegroundNot RunningInactiveActiveBackgroundedSuspended

Xamarin.iOS notifies us of all these states using various overrides in AppDelegate.cs

22

MethodStateAppDelegate.csNot RunningInactiveActiveBackgroundedSuspendedOnActivated(UIApplication)OnResignActivationDidEnterBackgroundWillEnterForegroundWillTerminate

23

AppDelegate.csAppDelegateViewController.csUIViewControllerStoryboard

24

Model-View-Controller (MVC)

ModelViewController

Performs ActionChanges ModelUpdates UIUser Sees Changes

25

Demo

Demo time if so desired26

RecapDefine the ProblemHow Xamarin WorksDevelopment EnvironmentiOS Application Life CycleDemo - Bing Images

Lets talk a bit about C# and why it is awesome.27

Thanks you Questions?

Microsoft and Xamarin MVP@Tinytoot | www.tomwalker.codesTom Walker

Xamarin Introduction! 28