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
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.6k
About HealthKit nutrition
coe
0
500
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
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
310
HacobuにおけるFDEとは/登壇資料(戸井田 裕貴)
hacobu
PRO
1
780
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
380
SDDの運用にめげずに向き合った話
sansantech
PRO
0
130
IoTデバイスを繋げるプロトコルMatterをAndroidで使用する方法
harutiro
0
120
AIアプリを使い分けるための共通ツール基盤を考えてみる#devio2026
osawa
0
250
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
330
プロダクト価値を、 チームが使える判断軸に変える
vivion
0
110
Kernel testing frameworks
ennael
PRO
0
110
Codex概要
ymiya55
0
400
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
200
[2026 Oracle Technical Deep Dive] AI時代のアプリケーションを支えるCloud NativeとJava EEモダナイゼーション (2026年9月17日開催)
oracle4engineer
PRO
0
120
Featured
See All Featured
Design in an AI World
tapps
1
350
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Making Projects Easy
brettharned
120
6.8k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
390
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
470
Navigating Weather and Climate Data
rabernat
0
550
WENDY [Excerpt]
tessaabrams
14
40k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The Invisible Side of Design
smashingmag
301
52k
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まで!