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
titanium mokumoku 20140319
Search
coe
March 21, 2014
Technology
110
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
480
Kotlin Dynamic type
coe
0
420
iOSDC 2023 Web in tvOS and watchOS
coe
1
1.1k
iOSDC 2023 Push To Talk
coe
1
2.8k
iOSDC手で触れずにアプリを動かす技術
coe
1
2.3k
iOSDC令和時代のXML処理を考える
coe
3
3.2k
iOSDC 2021 Restore
coe
6
2.4k
詳解Storyboard
coe
7
4.1k
Other Decks in Technology
See All in Technology
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
340
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
AI研修(Day2)【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
770
Git 研修【MIXI 26新卒技術研修】#2
mixi_engineers
PRO
1
260
StepFunctionsとGraphRAGを活用した暗黙知活用のためのRAG基盤
yakumo
0
180
副作用のある Lambda でも Lambda Power Tuning は使えるのか / lambda-power-tuning-side-effects
koukihosaka
2
150
Jitera Company Deck
jitera
0
580
データと地図で読む 大井町の「かわるもの、かわらないもの」
yoshiyama_hana
0
390
データエンジニアこそ組織のオントロジーに向き合うべき — 問いに答えるAIから、事業を動かすAIへ
gappy50
2
410
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
1.1k
コンポーネント名には何を含めるべきなのか? / what-should-be-included-in-component-names
airrnot1106
0
110
AI x 開発生産性を取り巻く予算戦略と投資対効果
i35_267
8
3.4k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Prompt Engineering for Job Search
mfonobong
0
380
Google's AI Overviews - The New Search
badams
0
1.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
630
Writing Fast Ruby
sferik
630
63k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
520
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
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まで!