Share
Embed
Transcript
58 slides
-
About Me Greg Shackles Senior Software Engineer OLO Online Ordering
email [email protected] twitter @gshackles github github.com/gshackles blog gregshackles.com Slides speakerdeck.com/u/gshackles Sunday, September 16, 12 -
the Book oreil.ly/Lp5smR Discount Code: AUTHD Print Book: 40% Off
E-Book: 50% Off Sunday, September 16, 12 -
Market Share (US): July 2012 Google Apple RIM Microsoft Symbian
52.2% Android 33.4% Apple 9.5% RIM 3.6% Microsoft Source: comScore Sunday, September 16, 12 -
"The biggest mistake we made as a company was betting
too much on HTML5 instead of native." - Mark Zuckerberg Sunday, September 16, 12 -
The Power of C# •Base Class Library •LINQ •Parallel LINQ
Sunday, September 16, 12 -
The Power of C# •Base Class Library •LINQ •Parallel LINQ
•Memory Management Sunday, September 16, 12 -
The Power of C# •Base Class Library •LINQ •Parallel LINQ
•Memory Management •Task Parallel Library Sunday, September 16, 12 -
The Power of C# •Base Class Library •LINQ •Parallel LINQ
•Memory Management •Task Parallel Library •Dynamic Sunday, September 16, 12 -
xamarin Tools xamarin.com •Access to full platform SDKs •100% Native
Sunday, September 16, 12 -
xamarin Tools xamarin.com •Access to full platform SDKs •100% Native
•Linker Sunday, September 16, 12 -
xamarin Tools xamarin.com •Access to full platform SDKs •100% Native
•Linker •frequent releases Sunday, September 16, 12 -
xamarin Tools xamarin.com •Access to full platform SDKs •100% Native
•Linker •frequent releases •active community Sunday, September 16, 12 -
xamarin Tools xamarin.com •Access to full platform SDKs •100% Native
•Linker •frequent releases •active community •Improved API Sunday, September 16, 12 -
CFStringRef keys[] = { kCTFontAttributeName,
kCTForegroundColorAttributeName }; CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }; attr = CFDictionaryCreate ( kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); astr = CFAttributedStringCreate( kCFAllocatorDefault, CFSTR("Hello World"), attr); obj-c Sunday, September 16, 12 -
C# CFStringRef keys[] = { kCTFontAttributeName,
kCTForegroundColorAttributeName }; CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }; attr = CFDictionaryCreate ( kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); astr = CFAttributedStringCreate( kCFAllocatorDefault, CFSTR("Hello World"), attr); obj-c var attr = new CFStringAttributes { Font = listLineCTFont, ForegroundColor = UIColor.Black.CGColor }; var astr = new NSAttributedString ("Hello World", attrs); Sunday, September 16, 12 -
<activity android:name=".SampleActivity" android:label="@string/app_name"> <intent-‐filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-‐filter> </activity> findViewById(R.id.button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // handle click } } ); Java Sunday, September 16, 12 -
C# <activity android:name=".SampleActivity" android:label="@string/app_name">
<intent-‐filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-‐filter> </activity> findViewById(R.id.button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // handle click } } ); Java [Activity(Label="@string/AppName", MainLauncher=true)] FindViewById<Button>(Resource.Id.Button).Click += delegate { // handle click }; Sunday, September 16, 12 -
•Powerful and mature language •Skill reuse •Native apps •Code reuse
across platforms Benefits even non-mobile platforms! Sunday, September 16, 12 -
app Architecture UI# C## Run)me# Pla/orm# Silverlight# Business#Logic# .NET# WP7#
iOS# Mono# Android# MonoTouch# Mono#for# Android# Sunday, September 16, 12 -
What code can be shared? •Most non-UI or platform code
Sunday, September 16, 12 -
What code can be shared? •Most non-UI or platform code
•Core application logic Sunday, September 16, 12 -
What code can be shared? •Most non-UI or platform code
•Core application logic •Entities Sunday, September 16, 12 -
What code can be shared? •Most non-UI or platform code
•Core application logic •Entities •LINQ (objects, XML) Sunday, September 16, 12 -
What code can be shared? •Most non-UI or platform code
•Core application logic •Entities •LINQ (objects, XML) •Network access Sunday, September 16, 12 -
What code can be shared? * with some limitations •Most
non-UI or platform code •Core application logic •Entities •LINQ (objects, XML) •Network access •File / Database Access * Sunday, September 16, 12 -
sharing techniques •File Linking •Abstraction •Observer Pattern •Partial Classes and
Methods Sunday, September 16, 12 -
sharing techniques •File Linking •Abstraction •Observer Pattern •Partial Classes and
Methods •Conditional Compilation Sunday, September 16, 12 -
sharing techniques * currently in development •File Linking •Abstraction •Observer
Pattern •Partial Classes and Methods •Conditional Compilation •portable class libraries * Sunday, September 16, 12 -
Case Study: iCircuit http://praeclarum.org/post/15789866032/icircuit-code-reuse-part-trois 19% 81% Shared Platform 31% 69%
13% 87% iOS WP7 Mac Sunday, September 16, 12 -
Case Study: TouchDraw http://lipsky.me/2012/9/11/touchdraw-code-reuse-updated 39% 61% Shared Platform 24% 76%
28% 72% iOS Mac Android Sunday, September 16, 12