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# (Monk...
Search
Greg Shackles
October 18, 2012
Programming
1.8k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cross-Platform Mobile Development with C# (MonkeySpace 2012)
Greg Shackles
October 18, 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
680
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 Programming
See All in Programming
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
830
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
340
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
380
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
250
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
120
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.7k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
340
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
460
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
360
act1-costs.pdf
sumedhbala
0
170
Featured
See All Featured
Done Done
chrislema
186
16k
Being A Developer After 40
akosma
91
590k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
260
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Six Lessons from altMBA
skipperchong
29
4.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
How to Ace a Technical Interview
jacobian
281
24k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
450
Facilitating Awesome Meetings
lara
57
7k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
580
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Transcript
Greg Shackles Cross-platform mobile development with c#
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
nycmobiledev.net @NYCMobileDev
the Book oreil.ly/Lp5smR Discount Code: AUTHD Print Book: 40% Off
E-Book: 50% Off
Market Share (US): August 2012 Google Apple RIM Microsoft Symbian
52.6% Android 34.3% Apple 8.3% RIM 3.6% Microsoft Source: comScore
native platform Languages Objective-C Java C#
Write once, run anywhere
"The biggest mistake we made as a company was betting
too much on HTML5 instead of native." - Mark Zuckerberg
Embrace the differences != !=
c# Everywhere MonoTouch Mono for Android Native
The Power of C# •Base Class Library •LINQ •Parallel LINQ
•Memory Management •Task Parallel Library •Dynamic •Skill Reuse
xamarin Tools •Access to full platform SDKs •100% Native •Linker
•Debugging •frequent releases •active community •Improved API
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);
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 };
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UI and Platform Code Shared Code
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 *
sharing techniques •File Linking •Abstraction •Observer Pattern •Partial Classes and
Methods •Conditional Compilation •portable class libraries
library: xamarin.mobile Supports iOS, Android and Windows Phone xamarin.com/mobileapi
None
Case Study: iCircuit
http://praeclarum.org/post/31799384896/icircuit-code-reuse-the-fourth-edition 16% 84% Shared Platform 31% 69% 13% 87% iOS
WP7 Mac 19% 81% Android Case Study: iCircuit
Case Study: TouchDraw
http://lipsky.me/2012/9/11/touchdraw-code-reuse-updated 39% 61% Shared Platform 24% 76% 28% 72% iOS
Mac Android Case Study: TouchDraw
SignalR Client Libraries http://github.com/gshackles/SignalR C# To Go Mono.CSharp http://github.com/gshackles/CSharpToGo Case
Study: Class Libraries
Questions?