Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Xamarin + MvvmCross で作る iOS/Android アプリ
2014/05/03(Sat) Kyoto.なんか #kyotoasterisk
Nobuhiro Ito
May 03, 2014
More Decks by Nobuhiro Ito
See All by Nobuhiro Ito
Introduction of Aizome - 多言語対応とスタイル適用を両立する書式付き文字列ライブラリ
iseebi
0
170
Bitriseで本をビルドする / Build a book with Bitrise
iseebi
0
180
BitriseでmacOSアプリをビルドする / Build macOS apps with Bitrise
iseebi
1
880
iOS/Androidアプリ転送ツール TransporterPadの紹介
iseebi
0
6.2k
Apple Developer Enterprise Program でどこまでいけるのか
iseebi
0
810
ReactiveProperty を使ったアプリの設計に Realm Xamarin を組み合わせる
iseebi
0
680
ReactiveProperty で Xamarin アプリの作り方が変わった
iseebi
3
1.8k
600件のPull RequestからみたXamarinのはまりどころ
iseebi
3
4.4k
Yet Another Cross Platform Development
iseebi
0
4.3k
Other Decks in Programming
See All in Programming
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.9k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
AWSに止められる覚悟してますか?
morizo_1984
2
460
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
700
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
カツオ、ご期待ください
suneo3476
0
110
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
350
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
210
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
160
一人だけ、Kiroが静止する日
hideg
0
130
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The World Runs on Bad Software
bkeepers
PRO
72
12k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.1k
Accessibility Awareness
sabderemane
1
220
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
BBQ
matthewcrist
89
10k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
510
A Soul's Torment
seathinner
8
3.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
520
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
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/