MeeGo Application開発 2010/12/09

Youngsik Yoon Software Application Engineer Software and Services Group

*Other names and brands may be claimed as the property of others Software and Services Group 1 Agenda

• サンプルApplication • MeeGo SDK • MeeGo Touch Framework (MTF) • Connman • D-Bus • サンプルApplicationの実装 • まとめ • Q/A • 参照

*Other names and brands may be claimed as the property of others Software and Services Group 2 サンプルApplication

*Other names and brands may be claimed as the property of others Software and Services Group 3 サンプルApplication

• MeeGoのConnection Manager(Connman)からデバイスの接続状態を 取得し表示する。 • Connmanを使ってApplication上で接続のOn/Offを行う

*Other names and brands may be claimed as the property of others Software and Services Group 4 MeeGo Architecture

*Other names and brands may be claimed as the property of others Software and Services Group 5 MeeGo SDK

*Other names and brands may be claimed as the property of others Software and Services Group 6 MeeGo SDK

• MeeGo SDK 1.1 Beta (2010年11月9日リリース) - Linux版( 9.10, 10.04, Fedora 12, 13) - QtCreator 2.0.1 (qt-tools 4.7.0) & MeeGo Toolchains - MeeGo Application Develop and Debug Environment (MADDE) 0.7.53 - qemu-glとQEMU用OS images core (armv7l, ia32) handset (armv7l, ia32) netbook (ia32)

• Windows版 - テスト版を試すことができる http://wiki.meego.com/SDK/MeeGo_SDK_for_Windows

*Other names and brands may be claimed as the property of others Software and Services Group 7 二つのオプション

• MeeGo chroot + - ホストマシン上で直接実行(シミュレーター) - グラフィックス・ハードウェア加速があればもっとよい - chrootした環境からQT Creatorを使う - 速度が速い

• MeeGo Toolchain + QEMU - QEMU仮想マシーンを使用(エミュレーター) - バーチャライゼーション(VT)とグラフィックス・ハードウェア加速が必要 - QT Creatorとの統合 - 柔軟性が高い(必要ならターミナルからsshで接続し操作)

*Other names and brands may be claimed as the property of others Software and Services Group 8 MeeGo chroot + Xephyr

*Other names and brands may be claimed as the property of others Software and Services Group 9 MeeGo Toolchain + QEMU

*Other names and brands may be claimed as the property of others Software and Services Group 10 MeeGo chroot + Xephyrのセットアップ - 1

* 具体的な手順は以下のwikiを参照 http://wiki.meego.com/MeeGo_SDK_with_Xephyr http://wiki.meego.com/Building_a_MeeGo_chroot_on_Linux

1. chrootのdownload wget http://download3.meego.com/meego-sdk-chroot

2. Handset OS image(Aava)のdownload http://meego.com/downloads/releases/1.1/meego-v1.1-handset

3. kpartxを使ってOS imageを作業Directoryに展開する sudo kpartx -a -v ./meego-handset-ia32-aava-mtf-1.1-sda.bin sudo mount /dev/mapper/loop0p1 ./tmp-mnt -o loop,ro sudo cp –a ./tmp-mnt ./handset-chroot

*Other names and brands may be claimed as the property of others Software and Services Group 11 MeeGo chroot + Xephyrのセットアップ - 2

4. 展開した作業directoryにchroot sudo meego-sdk-chroot ./handset-chroot/

5. chrootの中で必要なPackageをインストール zypper addrepo http://download.meego.com/live/devel:/tools:/sdk:/ target/MeeGo_1.1/ meego-sdk zypper install meego-simulator-launcher-handset

6. Xephyr上でMeeGo handsetを実行 startmeego &

*Other names and brands may be claimed as the property of others Software and Services Group 12 MeeGo Touch Framework (MTF)

*Other names and brands may be claimed as the property of others Software and Services Group 13 MeeGo Touch Framework (MTF) - 1

• Platform API (MeeGo APIではない) • QGraphicsViewをベースとしたUI Framework • QGraphicsViewをベースとしたWidgetを提供 • タッチ操作に最適化されたUI Framework

*Other names and brands may be claimed as the property of others Software and Services Group 14 MeeGo Touch Framework (MTF) - 2

• テーマー機能 • CSSを使ってソースコードをいじることなくLook&Feelをカスタマイズ • 自動Screenローテーション

*Other names and brands may be claimed as the property of others Software and Services Group 15 libmeegotouch-qtstyle

• QtStyle plugin • QT WidgetをMeeGo Touch FrameworkのWidget Styleに 見せてくれる

*Other names and brands may be claimed as the property of others Software and Services Group 16 QT Quick – QML

• JavaScriptベースのUIプログラミング言語、UI を宣言的に記述する • Web / Graphics デザイナーからも使いやすい • QT Quick ComponentsでMeeGo Handset Look&Feelの Widgetを提供

*Other names and brands may be claimed as the property of others Software and Services Group 17 Connman

*Other names and brands may be claimed as the property of others Software and Services Group 18 Connman (Connection Manager)

• 複雑性の回避 (HAL/DeviceKitを使わない) • UIに依存しない構造 (複数のUIが同時実行可能) • Plug-in拡張 • 最小限の依存関係 - C library - GLib core (mainloop, string処理など) - D-Bus低レベルlibrary (GobjectベースのD-Bus bindingではない、 libgdbus helper libraryだけをコピーして使用) - library (optional) • Embeddedでの使用を考慮 • Ubuntuから試すには - $ apt-get install connman connman-gnome

*Other names and brands may be claimed as the property of others Software and Services Group 19 User Interface

• UIはDBusを使ってConnmanのcore daemonと通信 • すべてのステータス変更はDBus signalを通じて完全非同期でUI側に 通知される • 複数のUIを同時実行

*Other names and brands may be claimed as the property of others Software and Services Group 20 D-Bus

*Other names and brands may be claimed as the property of others Software and Services Group 21 D-Bus - 1

• Freedesktop.orgのプロジェクト

• IPC(Inter-Process Communications)システムの一種 - Desktop Application間のコミュニケーション - DesktopセッションとOS&System daemon間のコミュニケーション

• Server – Client モデル

• Service(Server側)の自動実行メカニズムを提供

• いろんなラッパーライブラリ - Qt, Glib, Python, Java, C#

*Other names and brands may be claimed as the property of others Software and Services Group 22 D-Bus - 2

• Message Bus - Session Bus - System Bus • Message Type - Method call - Signal - Reply - Error • Messageの宛て先 - Service - Object Path - Interface - Method / Signal

*Other names and brands may be claimed as the property of others Software and Services Group 23 D-Busツール

• dbus-send - $ dbus-send --system --print-reply --dest=org.ofono /modem1 org.ofono.Phonebook.Import

• dbus-monitor - $ dbus-monitor --system

• d-feet

• qdbusviewer

*Other names and brands may be claimed as the property of others Software and Services Group 24 サンプルApplicationの実装

*Other names and brands may be claimed as the property of others Software and Services Group 25 Window表示

*Other names and brands may be claimed as the property of others Software and Services Group 26 Layout作成とWidget追加

*Other names and brands may be claimed as the property of others Software and Services Group 27 Screenローテーション • MeeGo Touch Frameworkで作られたApplicationはDefaultで Screenローテーションに対応している

• Screenローテーションに合わせて 独自のLayoutを指定することも可能

*Other names and brands may be claimed as the property of others Software and Services Group 28 ApplicationからDBus経由でConnmanのAPI を呼ぶ

• QTでDBusを使う三つの方法 - QDBusMessageを使う: 一回のMessageのやり取り - QDBusInterfaceを使う: 提供されるMethodを複雑に操作 - QtDBus XML compiler(qdbusxml2cpp)を使う: もっとも簡単な方法、 Service側APIのXML定義ファイルをベースにC++Proxyクラスを生成

• 今回使うConnmanのAPI - GetProperties: デバイスの接続状態を含めすべての属性を取得 - EnableTechnology: 特定接続をOn - DisableTechnology: 特定接続をOff - PropertyChanged:デバイスの接続状態などの属性が変更されると このSignalが通知される

*Other names and brands may be claimed as the property of others Software and Services Group 29 qdbusxml2cppでProxyクラスを生成 • 通常Application側はService側の org.freedesktop.DBus.Introspectableインタフェースの Introspectメッソドを呼べばXML定義を取得できるが、Connmanでは なかったので使うAPIをベースに直接XMLを作成する

• 作ったXMLをベースにProxyクラスを生成 - $ qdbusxml2cpp -p manager_interface connman-manager.xml (manager_interface.hとmanager_interface.cppが生成される)

*Other names and brands may be claimed as the property of others Software and Services Group 30 Proxyクラスを利用してデバイスの接続状態取得 - 1

*Other names and brands may be claimed as the property of others Software and Services Group 31 Proxyクラスを利用してデバイスの接続状態取得 - 2

*Other names and brands may be claimed as the property of others Software and Services Group 32 実行 – 状態取得&表示

*Other names and brands may be claimed as the property of others Software and Services Group 33 Proxyクラスを利用して接続をOn/Off

*Other names and brands may be claimed as the property of others Software and Services Group 34 実行 – 接続Off

*Other names and brands may be claimed as the property of others Software and Services Group 35 実行 – 接続On

*Other names and brands may be claimed as the property of others Software and Services Group 36 まとめ

• MeeGo SDKをDownloadしMeeGo Handset・Netbookの開発 環境を構築してみましょう。

• MeeGo SDKのWindows版も近々リリースされる予定であり、その開 発環境は益々充実してきています。

*Other names and brands may be claimed as the property of others Software and Services Group 37 Q&A

*Other names and brands may be claimed as the property of others Software and Services Group 38 参照

• MeeGo − http://meego.com (MeeGo本家サイト) − http://meego.jp (日本MeeGoサイト) − http://meego-users.jp (日本MeeGoユーザー会サイト) • MeeGo SDK − http://meego.com/downloads/releases/1.1/meego-v1.1-sdk − http://wiki.meego.com/Getting_started_with_the_MeeGo_SDK • MeeGo ソース − http://meego.gitorious.org/ • Connman − http://connman.net/ • D-Bus − http://dbus.freedesktop.org/

*Other names and brands may be claimed as the property of others Software and Services Group 39 Back up

*Other names and brands may be claimed as the property of others Software and Services Group 40