Four Platforms, One Codebase

30
Four Platforms, One Codebase Cross Platform Mobile Apps with Xamarin rob gibbens interactive business systems

description

You want to write mobile apps, but you don’t want to write the same code four times over. You want cross-platform apps, but you don’t want to sacrifice the native speed and power. You want to create native iOS, Android, Windows Phone, and Windows 8 apps, and you want it all while maximizing code reuse and harnessing the power and simplicity of C#. You want four native platforms, but you want one codebase. Of course you do. You want Xamarin.

Transcript of Four Platforms, One Codebase

Page 1: Four Platforms, One Codebase

Four Platforms, One Codebase Cross Platform Mobile Apps with Xamarin

rob gibbensinteractive business systems

Page 2: Four Platforms, One Codebase
Page 3: Four Platforms, One Codebase

what does an app cost?

Page 4: Four Platforms, One Codebase
Page 5: Four Platforms, One Codebase

mobile development approaches

Page 6: Four Platforms, One Codebase

silos• build app multiple times• multiple teams• multiple code bases• different toolsets

Page 7: Four Platforms, One Codebase

write once, run anywhere• lowest common denominator• browser fragmentation• developing and designing for one platform

Page 8: Four Platforms, One Codebase
Page 9: Four Platforms, One Codebase

xamarin‘s unique approach• native user interface• native performance• shared code across platforms• c# and .net framework• full api coverage

Page 10: Four Platforms, One Codebase

why C#?

Page 11: Four Platforms, One Codebase

C# is awesome• async/await• linq• xml + xdocument• event handling, delgates, lambdas• generics

Page 12: Four Platforms, One Codebase

+ (NSDate *) stripTime:(NSDate *) date { NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];

NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:date];

date = [gregorian dateFromComponents:components];

[gregorian release];

return date; }

Page 13: Four Platforms, One Codebase

var newDate = date.Date;

Page 14: Four Platforms, One Codebase

NSString *string = @“ spaces in front and at the end “;NSString *trimmedString = [string stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];

Page 15: Four Platforms, One Codebase

var trimmedString = “ spaces in front and at the end “.Trim();

Page 16: Four Platforms, One Codebase
Page 17: Four Platforms, One Codebase
Page 18: Four Platforms, One Codebase
Page 19: Four Platforms, One Codebase

mvvm

Page 20: Four Platforms, One Codebase
Page 21: Four Platforms, One Codebase
Page 22: Four Platforms, One Codebase
Page 23: Four Platforms, One Codebase

mvvmCross

Page 24: Four Platforms, One Codebase
Page 25: Four Platforms, One Codebase
Page 26: Four Platforms, One Codebase

json serializer

file system

sqlite

message busvisibili

ty

download cache

gps

web browser

photos localizati

on

email

networkphone

callacceleromet

er

Page 27: Four Platforms, One Codebase

let’s code!

Page 28: Four Platforms, One Codebase
Page 29: Four Platforms, One Codebase

http://www.ibs.comhttp://www.ibs.com

Page 30: Four Platforms, One Codebase

Contact

Rob Gibbens

github: http://github.com/RobGibbens/MvvmDemotwitter: @RobGibbensemail : [email protected]