Titanium Mobile
を超簡単に紹介するよ


      Shingo Mori
     ConnectionWorks Inc.
自己紹介
Shingo Mori
森 真 吾
• ConnectionWorks
             Inc. from Nagoya
• (株)コネクションワークス


• @sngmr


• ソフトウェアエンジニア
•   兼営業兼企画兼コンサル兼経理


• Titanium   Certified Application Developer
Titanium Mobile
ってなに?
JavaScript
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    // insert code here...
    MyClass *obj = [[MyClass alloc] init];
    int value = [obj add:1 val2:2];

    [obj release];
    [pool drain];
    return 0;
}
ヤダ… (´・ω・`)



括弧ばっかりで

気持ち悪い…
function main() {
  var obj = new MyClass();
  var value = obj(1, 2);
}
( ・∀・)イイ!!
しかも

iOSとAndroidが

両方イケる (バイ)
‣ クロスプラットフォーム・モバイルアプリケーション開発環境

 ‣ iOS   (iPhone, iPad, iPod touch)
 ‣ Android

 ‣ Brackberry   (beta)
 ‣ Mobile   Web (beta)
‣ 開発元は

 ‣ Appcelerator   Inc.
 ‣ アメリカ・マウンテンビュー(シリコンバレー)

‣ オープンソース

 ‣ Titanium   Mobile SDKはGithubでOpenに開発
どうやって動くの?
Titanium Mobileのアーキテクチャ


          アプリケーションコード

   APIs         Modules     APIs     Modules

  JSインタプリタ                JSインタプリタ

          iOS               Android OS
  Native iOS app          Native Android app
実際に使われてるの?
1.5 MILLION
DEVELOPERS
Japan?
なにがすごいの?

どこまでやれるの?
Native UI が使える
•User Experience !!!
•慣れ親しんだUIが使える
機能は(だいたい)全部使えます
 Native User Experience
                                        Multimedia
 Native performance + Native UI
                                        Camera, video camera, streaming /
 (tables, animations, gestures, etc).
                                        device audio/video


 Location-based Services                Analytics
                                        Integrated user, session, and custom
 Augmented reality, geo-location,
                                        analytics. Interactive web-based
 compass, native maps
                                        analysis tools. Geo-analytics.


 Social Sharing
 Authenticated access to Facebook,      Titanium Plus
 Twitter, Yahoo YQL. Native email/      Add any native Obj. C (iPhone) or Java
 address book.                          (Android) module into Titanium



 Data
 Access online / device data,           Development Tools
 embedded SQL database, filesystem,     Create, test, and publish your app
 web services
なにが苦手?
•リアルタイム性が要求されるものは厳しい
•メモリも少し食う
•UIデザイナがないよー
 •CSSを直打ちするイメージでデザイン
TitaniumのAPIに無い
機能が使いたい !!
•Objective-C(iOS)またはJava(Android)で
拡張Moduleが作れる!
•Open Mobile Marketplaceで買う事も!
Open Mobile Marketplace
なにがいるの?
iOSアプリを作る場合
‣ 開発にはMacが必須です

‣ Lionの場合は必須ではありませんが、iOS         Dev Centerに登録
しましょう。 ります。Freeです。

‣ XcodeをAppStoreからダウンロード

‣ Command   Line Tools for XcodeもAppleからダウンロード

  ‣ Gitがあると便利なので

‣ 実機に転送したい場合は、iOS        Developer Programへの加入
が必要(年8,400円のお布施)
Androidアプリを作る場合

‣ WindowsでもいいけどMacのがいい・・・かも


‣ Android     SDK をダウンロード

‣ Android
        SDK ManagerでターゲットバージョンのSDKをダ
    ウンロード

‣   ごめんなさい。Androidあんまりやってないのでちょっと曖昧です
どちらの場合でも
‣ JDK(Java    Development Kit)のインストール

‣ Appceleratorへ開発者登録

‣ Titanium   Studioのダウンロード

‣ Titanium   Studio内からTitanium Mobile SDKのダウン
 ロード

‣ 開発マシンは・・・

  ‣ 速いCPUと富豪なメモリがあった方がいいです
お高いんでしょ?
無料です!!
(基本)
デバッグめんどそう
‣Titanium Studio上からデバッグ可能
  ‣ただしシミュレータのみ
  ‣実機デバッグは開発中だそうです

‣break point で変数の中身を確認できる

‣iPhoneシュミレータは普通に動く
‣Androidシュミレータは・・・まぁ動く(遅い)
どういうふうに書くの?
var win = Ti.UI.createWindow({
    layout: 'vertical',
    backgroundColor: '#666'
});
               createLabel
win.add(Ti.UI.createLabel({
    text: 'about @sngmr',
    color: '#FFF'
}));
win.add(Ti.UI.createTableView({
               createTableView
     data: [
         { title: '名前', hasDetail: true },
        { title: '生年月日', hasDetail: true },
        { title: '性別', hasDetail: true },
        { title: '身長', hasDetail: true },
        { title: '体重', hasDetail: true },
        { title: '年収(別料金が必要)', hasDetail: true }
    ],
    style: Ti.UI.iPhone.TableViewStyle.GROUPED
}));
win.open();
    open
Reference
‣Download
  ‣http://www.appcelerator.com/

‣Documents
  ‣http://docs.appcelerator.com/

‣Sample
  ‣Titanium Studio -> Samples
    ‣KitchenSink (UI部品の使い方のみ参考に!!)
    ‣その他(コードの組み方とか全般)
Question?
ありがとうございました

福井スマートフォンハッカソン Titanium Mobileの紹介