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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
150
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.7k
Other Decks in Programming
See All in Programming
Lessons from Spec-Driven Development
simas
PRO
0
180
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
2k
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
110
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
890
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
Agentic UI
manfredsteyer
PRO
0
150
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.2k
Oxcを導入して開発体験が向上した話
yug1224
4
310
JavaDoc 再入門
nagise
0
330
さぁV100、メモリをお食べ・・・
nilpe
0
140
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Featured
See All Featured
Bash Introduction
62gerente
615
220k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
The Cost Of JavaScript in 2023
addyosmani
55
10k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Designing Experiences People Love
moore
143
24k
Code Review Best Practice
trishagee
74
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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?