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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
titanium mokumoku 20140319
Search
coe
March 21, 2014
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
titanium mokumoku 20140319
Titanium Cross Platform
coe
March 21, 2014
More Decks by coe
See All by coe
すべてのヘルスケアデータを紐解く.pdf
coe
0
3.5k
About HealthKit nutrition
coe
0
490
Kotlin Dynamic type
coe
0
430
iOSDC 2023 Web in tvOS and watchOS
coe
1
1.1k
iOSDC 2023 Push To Talk
coe
1
2.8k
iOSDC手で触れずにアプリを動かす技術
coe
1
2.4k
iOSDC令和時代のXML処理を考える
coe
3
3.3k
iOSDC 2021 Restore
coe
6
2.4k
詳解Storyboard
coe
7
4.2k
Other Decks in Technology
See All in Technology
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
270
AIオーケストレーションを活用した 開発ワークフローの設計と実践
bqnq
0
120
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
250
omasushiというライブラリを作った
polidog
PRO
0
160
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
1
210
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
240
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
430
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
140
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
930
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
110
Omarchy Quattro の日本語設定周り
simosako
2
110
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Designing for Timeless Needs
cassininazir
1
470
How to train your dragon (web standard)
notwaldorf
97
6.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Product Roadmaps are Hard
iamctodd
55
13k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
600
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
210
The Spectacular Lies of Maps
axbom
PRO
1
980
Paper Plane (Part 1)
katiecoart
PRO
1
11k
4 Signs Your Business is Dying
shpigford
187
23k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
840
Transcript
それでも TitaniumでiPhone,Android クロスプラットフォームを諦めない 2014.03.19 日向強 @coffeegyunyu
* このスライドはCoffeeScriptを多⽤用してます。 CoffeeScriptアレルギーの⼈人はご注意ください。 * ここに出ているのはあくまで個⼈人の⽤用例例ですので、 「100%こうしたほうがいいよ」というものでは ないのであしからず。 Caution
自己紹介 ⽇日向強 株式会社アールラーニング 開発事業部 モバイルのプロジェクト (iOS,Android)を主にやってます
Titaniumでつくったもの Font Stamp ⽂文字とフォントを組み合わせて各種SNSに 画像を送信するアプリ ダウンロード数は33,000 Titanium3.2.0 使⽤用 https://play.google.com/store/apps/details?
id=jp.coe.fontstamp https://itunes.apple.com/jp/app/ fontosutanpu-‐wen-‐zisutanpuga/id687721425? mt=8
Titaniumでつくったもの coe 声を使ったソーシャルレコーディングアプリ 声を録⾳音し、現在位置に声を置いておくことで、 他の⼈人が声を拾拾って聞くことができるアプリ 現在3000件ほど声が世界中においてあります Titanium 3.2.0使⽤用 https://itunes.apple.com/jp/app/coe-‐‑‒ shengdetsunagaruapuri/id367895344?mt=8
https://play.google.com/store/apps/details? id=jp.coe.coe
Titaniumの悪循環
Titaniumの悪循環 Titaniumで両⽅方作 れるらしいよ コストダウン できるのな ら・・・ iOSでは動かない Androidでもこの機能欲しい if(OS_IOS) If(OS_ANDROID)
もっと もっと iOS、Androidの分岐がいたる ところに⼊入ったメンテしづら いスパゲッティの出来上がり 各所各所でOSごとの分 岐を設けます ⼀一時的に要件は満たさ れます
プロジェクト作成編
* 新規プロジェクト作成時は、絶対にTitanium SDKを3.2.1 にしよう プロジェクト作成編
なんで? Titanium 3.1.3 Android Titanium 3.2.1 Android
* Titanium SDK 3.2.1だとデフォルトでAndroidの UIのサイズが最適化されるよ(<property name=“ti.ui.defaultunit” type=“string”>dp</ property>) *
Titanium SDK 3.2.1だと、Androidのデザインも かっちょよくなるよ(Theme.holo) なんで?
* 新規プロジェクト の選択について 画⾯面遷移が発⽣生する アプリだとわかって いる場合、 タブを使わなくても Two-‐‑‒tabbed Alloy
Applicationのほうが いい プロジェクト作成編
* 画⾯面遷移の処理理⽅方法をiOS,Androidで統⼀一できるから (iOSのNavigationWindowとか意識識しなくていい) なんで? #グローバルに現在のタブを保持 $.index.addEventListener "open", (e) -‐>
Alloy.Globals.currentTab = e.source.activeTab if e?.source?.activeTab? $.index.addEventListener "focus", (e) -‐> Alloy.Globals.currentTab = e.tab if e?.tab? clickMe = (e)-‐> nextwindow = Ti.UI.createWindow() Alloy.Globals.currentTab.open nextwindow #ここで画面遷移 $.index.open() app/controller/index.coffee
実際に画面遷移すると iPhone (前に戻るボタンが⾃自動付与) Android (Backキーで戻れる)
Controller編
* Android,iOSで明確に異なる記述で処理をする場合、 CoffeeScriptのクラスの機能を使用したほうが見通しやすい Controller編
Controller編 #共通機能クラス部分 class HogeWindowInplBase constructor:-‐> hello:(e)-‐>
alert "hello" thankyou:-‐> alert "Thank you" #OSによって使用する継承クラスを決定 IMPL = if OS_IOS then class HogeWindowInplIos extends HogeWindowInplBase hello:(e)-‐> alert "hello iOS" else if OS_ANDROID then class HogeWindowInplAndroid extends HogeWindowInplBase hello:(e)-‐> alert "hello Android" #コントローラ実装部 impl = new IMPL() clickHello = (e)-‐> impl.hello() #ここはOSによって異なる clickThankyou = (e)-‐> impl.thankyou() #ここはOS共通 app/controllers/HogeWindow.coffee
Controller編 iOS Android
UI編
* まずは、どのOSでも使える部品のみを使って画面を組 み立てる ドキュメントとにらめっこしましょう * その上で、OS個別の部品を使いたくなったら、app/ view/{それぞれのOS}/{ファイル名}.xmlを作成する UI編
UI編 ファイル構成例 └── views ├──
UIWindow.xml ←OS独自のビューが設定されていない場合 ├── index.xml └── ios └── UIWindow.xml ←iOS独自のビュー
UI編 iOS/UIWindow.xml UIWindow.xml <Alloy> <Window>
<View class="container"> <Button >hello</Button> <Button >thankyou</Button> </View> </Window> </Alloy> <Alloy> <Window> <Toolbar class="container"> <Items> <Button >hello</Button> <Button >thankyou</Button> </Items> </Toolbar> </Window> </Alloy> ※iOSなので、せっかくだからToolbarを使いたい!
UI編 iOS Andoird
現在アールラーニング では技術者を募集して います TitaniumやAndroid,iOSに限らず、 Java,Ruby,インフラetc… 技術に自信のある方は、お気軽に t-‐hyuga@r-‐learning.co.jpまで!