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
Xamarin + MvvmCross で作る iOS/Android アプリ
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nobuhiro Ito
May 03, 2014
Programming
1
1k
Xamarin + MvvmCross で作る iOS/Android アプリ
2014/05/03(Sat) Kyoto.なんか #kyotoasterisk
Nobuhiro Ito
May 03, 2014
Tweet
Share
More Decks by Nobuhiro Ito
See All by Nobuhiro Ito
Introduction of Aizome - 多言語対応とスタイル適用を両立する書式付き文字列ライブラリ
iseebi
0
140
Bitriseで本をビルドする / Build a book with Bitrise
iseebi
0
160
BitriseでmacOSアプリをビルドする / Build macOS apps with Bitrise
iseebi
1
830
iOS/Androidアプリ転送ツール TransporterPadの紹介
iseebi
0
6.1k
Apple Developer Enterprise Program でどこまでいけるのか
iseebi
0
790
ReactiveProperty を使ったアプリの設計に Realm Xamarin を組み合わせる
iseebi
0
670
ReactiveProperty で Xamarin アプリの作り方が変わった
iseebi
3
1.7k
600件のPull RequestからみたXamarinのはまりどころ
iseebi
3
4.3k
Yet Another Cross Platform Development
iseebi
0
4.2k
Other Decks in Programming
See All in Programming
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
AI時代の認知負荷との向き合い方
optfit
0
150
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
960
CSC307 Lecture 05
javiergs
PRO
0
490
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
組織で育むオブザーバビリティ
ryota_hnk
0
170
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AI巻き込み型コードレビューのススメ
nealle
0
120
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
AI & Enginnering
codelynx
0
110
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Designing for Performance
lara
610
70k
[SF Ruby Conf 2025] Rails X
palkan
0
740
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
930
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
63
Transcript
Xamarin + MvvmCross で作る iOS/Androidアプリ 伊勢 シン (@iseebi) Kyoto.なんか 2014/05/03(Sat)
⾃自⼰己紹介 • 伊藤 伸裕 / 伊勢 シン – @iseebi / id:iseebi
• フェンリル株式会社 共同開発部所属 – iOS / Android / Windows 8 のアプリ開発してます • コミュニティ – スマートフォン勉強会@関⻄西 – すごいHaskell読書会 in ⼤大阪 • H本読んでます。(2週⽬目)
Xamarin 2.0 • ネイティブの iOS / Android / Mac アプリを
C# で書ける! – Windows プラットフォームを⾜足せば、だいたいのプラッ トフォームのソースをC#で書いてしまえる。
処理理を共通化できます! • C#だけで書ける=iOS/Androidで処理理を共通化できる • アプリの性質にもよるが、3割から4割くらい共通化できま す。 PCL
なぜXamarin? • C# を使うプラットフォームでは MVVM という概念念がすでに体系化されている。 – Model-View-ViewModel • クロスプラットフォーム開発で MVVM
をサポートするライブラリもすでにある – MvvmCross – QuickCross
MVVM • MVなんとかの中でもバインディングに ものすごく依存している • 移し替えのコードがバグ出やすいので、 なるべくバインディングで解決させたい (と僕は思う) http://msdn.microsoft.com/en-us/library/gg405484(v=PandP.40).aspx#sec1
%&.0
プロジェクト初期設定 • プロジェクトの初期設定 – http://www.slideshare.net/iseebi/cross-platform- development-with-xamarin-20- mvvmcross-32190450 • NuGetで導⼊入する際、下記のものも⼊入れる –
MvvmCross – MvvmCross – DownloadCache Plugin • MvvmCross.HotTuna.Plugin.DownloadCache – MvvmCross – File Plugin • MvvmCross.HotTuna.Plugin.File – Microsoft HTTP Client Libraries (Coreのみ) • Microsoft.Net.Http
はてなフォトライフへのアクセス • gistを参考に – https://gist.github.com/iseebi/492486
ViewModel の作成 • 取得したデータを出す IEnumerable をプロパ ティに出す • Start のタイミングで読み込みを⾏行行う
iOSの実装 – セルの作成 • iPhone Table View Cell を追加すると、 .cs
と .xib が⽣生成される。 • 継承元を MvxTableViewCell に変更更 • .xib にコントロールを配置し、アウトレット接続 – Xcode上で⾏行行う – UIImageView は MvxImageView にする。 URLでバインディングできるようになる。 • DelayBind を記述する
iOSの実装 - ViewController • MvxTableViewController にする • インナークラスで TableViewSource を作る
– コンストラクタで RegisterCellForReuse する • ViewDidLoad でバインディングを作成
Androidの実装 - ListItem • Layout を追加する • xmlns に local
を追加する – xmlns:local="http://schemas.android.com/apk/ res-auto" • 各要素に local:MvxBind を追加する – コントロール側のプロパティ ViewModel側のプロパテ ィ で記述する – ImageView は Mvx.MvxImageView にする。
Android の実装 - View • ListView のかわりに Mvx.MvxListView を使⽤用 する。
• local:MvxBind に ViewModel とのバインディン グを作成 • local:MvxItemTemplate で、使⽤用するレイアウ トを指定する
デメリット • ライセンスが⾼高い – 会社で使うと1開発者1プラットフォーム 約10万円 – チームを組むと iOS /
Android 3本ずつ=60万 (実際はディスカウント⼊入るのでもうちょっと安い) • こまかい制限もちょいちょい – 動的コンパイル必要な機能は動かない • まあ、「お⾦金金が出るならアリ」の技術… – コード共有で浮くお⾦金金でライセンスを買おう
まとめ • Xamarin と MvvmCross を使うと、 iOS / Android アプリを効率率率的に開発できます。
参考URL • 今回のソース – https://github.com/iseebi/FotolifeViewer • Qiita の Xamarin タグ
(国内のXamarin系の⼈人の Qiita 参加率率率⾼高い) – http://qiita.com/tags/xamarin • Xamarin ⽇日本語情報 (国内代理理店の⼈人のblog) – http://ytabuchi.hatenablog.com/ • Xamarin Japan グループ (facebook) – https://www.facebook.com/groups/778386365523431/ • backyard of 伊勢的新常識識 (僕のblogです) – http://iseebi.hatenablog.com/