Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cross-Platform Mobile Development with C# (2012...
Search
Greg Shackles
September 17, 2012
Technology
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cross-Platform Mobile Development with C# (2012-09-17)
Greg Shackles
September 17, 2012
More Decks by Greg Shackles
See All by Greg Shackles
Building Modern Services with .NET Core 3 and gRPC
gshackles
0
210
Observability-Driven Development: What DevOps is Really About
gshackles
1
330
Monitoring Your Mobile Apps in the Wild
gshackles
1
120
Building Scalable Applications with the Actor Model
gshackles
0
690
Creating a Voice-Driven TV Remote with Azure and Alexa
gshackles
0
160
Build 2017 Recap for Xamarin Developers
gshackles
0
150
Going Serverless: Event-Driven Architecture Without The Infrastructure
gshackles
0
220
Evolve 2016 Redux
gshackles
0
160
Instrumenting Your Mobile Monitoring Strategy
gshackles
0
4.8k
Other Decks in Technology
See All in Technology
プロダクト開発組織の現在地(Ver.2026/07) / product-organization
kaonavi
0
450
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
240
Vポイント分析基盤におけるデータモデリング20年史
taromatsui_cccmkhd
4
750
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
1.2k
”AIを使う” から ”AIに任せる” へ ─ 開発プロセスを再設計してAIを組織標準にするまで
cyberagentdevelopers
PRO
2
140
【公開用】AI_Dev_Ex2026_AI_登壇資料
matsuritechnologies
PRO
2
560
JAWS_ICEBERG_BASECAMP
iqbocchi
2
110
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
1
500
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
490
reFACToring
moznion
0
220
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
290
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
490
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
410
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
360
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Making Projects Easy
brettharned
120
6.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
910
Being A Developer After 40
akosma
91
590k
What's in a price? How to price your products and services
michaelherold
247
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
HDC tutorial
michielstock
2
750
Building Applications with DynamoDB
mza
96
7.1k
Transcript
Greg Shackles Cross-platform mobile development with c# Sunday, September 16,
12
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
native platform Languages Objective-C Java C# Sunday, September 16, 12
Write once, run anywhere 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
platform differences != != Sunday, September 16, 12
c# Everywhere MonoTouch Mono for Android Native Sunday, September 16,
12
The Power of C# Sunday, September 16, 12
The Power of C# •Base Class Library Sunday, September 16,
12
The Power of C# •Base Class Library •LINQ 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 Sunday, September 16, 12
xamarin Tools xamarin.com •Access to full platform SDKs 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
Environment: iOS Mac OS X MonoDevelop Xcode Integration Sunday, September
16, 12
Environment: android Mac OS X Windows MonoDevelop Visual Studio Sunday,
September 16, 12
UI Designer: MonoDevelop and Visual Studio Environment: android Sunday, September
16, 12
Environment: windows phone Windows Visual Studio Sunday, September 16, 12
Benefits Sunday, September 16, 12
•Powerful and mature language Benefits Sunday, September 16, 12
•Powerful and mature language •Skill reuse Benefits Sunday, September 16,
12
•Powerful and mature language •Skill reuse •Native apps Benefits 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? 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 Sunday, September 16, 12
sharing techniques •File Linking Sunday, September 16, 12
sharing techniques •File Linking •Abstraction Sunday, September 16, 12
sharing techniques •File Linking •Abstraction •Observer Pattern 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
library: xamarin.mobile Supports iOS, Android and Windows Phone xamarin.com/mobileapi Sunday,
September 16, 12
Case Study: iCircuit 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 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
Demo Time Sunday, September 16, 12
Questions? Sunday, September 16, 12