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
作ろう! Android TVアプリ
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuki Nara
November 12, 2016
Programming
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
作ろう! Android TVアプリ
Android Night 2016/11/11
Kazuki Nara
November 12, 2016
More Decks by Kazuki Nara
See All by Kazuki Nara
FlutterアプリでChromecastに接続する
kazukinr
2
1.1k
プロジェクト開始以来継ぎ足しながら使ってきたソースを捨てた話
kazukinr
0
110
Room with Kotlin
kazukinr
0
36
AOSPにパッチを送ってみた
kazukinr
0
49
Other Decks in Programming
See All in Programming
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
230
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
210
Deep dive into the select statement (GopherCon UK)
jespino
0
170
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
150
Security issues being discussed on Web Platforms
petamoriken
0
730
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
140
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
700
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
A better future with KSS
kneath
240
18k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Amusing Abliteration
ianozsvald
1
290
A designer walks into a library…
pauljervisheath
211
25k
Designing for Timeless Needs
cassininazir
1
470
Transcript
作ろう! Android TVアプリ Kazuki Nara @ Android Night 2016/11/11
自己紹介 Kazuki Nara Software Engineer @ AWA Co. Ltd. http://github.com/kazukinr
http://www.facebook.com/kazuki.nara 虹はでない
What is Android TV
Android TVとは • TV端末向けのAndroidプラットフォーム • Google I/O 2014で発表 • 実機としてはNexus
Player、Sony BRAVIAなど
Google Play StoreはTV専用 • アプリのラインアップは多くない • ゲームアプリがメイン • 上位の顔ぶれにはあまり変化がない
TV用アプリの公開には審査が必要 • Android TVアプリにはGoogleの定めたガイドラインがある • TV対応アプリをGoogle Play Storeに登録すると審査が始まる • 審査期間は1営業日以下(アメリカ時間の平日昼に審査してるぽい)
• 審査NGの場合も通常のGoogle Play Storeの公開には影響なし 審査チェック項目は以下に書いてあります。 https://developer.android.com/distribute/essentials/quality/tv.html
あまり盛り上がってないかもしれない • Google I/O 2016では特に発表なし(Leanbackの更新くらい) • GoogleがNexus Playerの生産を終了 • これからはWear
2.0だぜ!みたいな流れきてる
Storeが過疎ってる →ライバルが少ない! 開発してる人も少ない →ライバr ユーザー少ない →もう増えるしかない BRAVIAがAndroid TVだって知らずに使ってる人多いよね・・・
None
How to launch the app on Android TV
とりあえずこう でも、これだと動かせても中身がよくわかりませんよね。
なにを設定すればAndroid TVで動くのか Android TVデバイスでアプリを起動するための最低限の設定 • バナーの設定 • TVホームから起動するランチャーActivityの設定 • TVでサポートしていない機能の除外設定
バナーの設定 • AndroidManifest.xmlの宣言 • バナー画像の準備 • バナーは320x180px、画像にテキスト(アプリ名)を含むこと • xhdpiリソースとして扱う <application
android:label=”@string/app_name” android:icon=”@drawable/ic_launcher” android:banner=”@drawable/tv_app_banner”>
起動Activityの宣言 • intent-filterでLEANBACK_LAUNCHERを受ける • このintent-filterを宣言するとTVアプリとして認識される <activity android:name=”.MainActivity” android:theme=”@style/Theme.Leanback”> <intent-filter> <action
android:name=”android.intent.action.MAIN”/> <category android:name=”android.intent.category.LEANBACK_LAUNCHER”/> </intent-filter> </activity>
TVでサポートしない機能の対応 • タッチスクリーンをrequired=”false”するのは必須 • それ以外にも、TVでサポートしない機能(カメラ、GPS等)をアプリ内で使用している 場合は、required=”false”が必要 <uses-features android:name=”android.hardware.touchscreen” android:required=”false”/> <uses-features
android:name=”android.software.leanback” android:required=”false”/>
ゲームの場合 • ゲームであるという宣言が必要 • ゲームコントローラーに対応する場合も設定が必要 <application android:isGame=”true” …> <uses-feature android:name=”android.hardware.gamepad”
android:required=”false”/> </application>
Android TVはLollipop以上です defaultConfig = { minSdkVersion 21 targetSdkVersion 24 …
} ジッサイウレシイ
How to build the UI
フォーカスで操作可能な画面を作る • D-padでの操作(上下左右+決定ボタン)での操作が可能であること • フォーカスがあたってることを伝える表現(selector-drawable等) <Button android:id=”@+id/button” android:text=”押せます” android:focusable=”true” android:focusableInTouchMode=”true”/>
フォーカス順は基本的にお任せでOK • レイアウトの位置関係に応じて、上下左右でフォーカス移動してくれます • translation等で描画位置を移動している場合は注意が必要 • Z軸は基本的に無視されるので、その点も注意が必要 • ListViewじゃなくてVerticalGridView/HorizontalGridView •
静的なフォーカス順はレイアウトxmlで定義可能(nextFocusUp等) • 動的なフォーカス順はコードでちょっとがんばりましょう • そもそも細かいフォーカス移動はNG(ユーザーがわかりづらい)
Leanback Support Library • Android TV用のUI構築用のライブラリ • 標準的なレイアウトの画面に関して、各種Fragmentが用意されている • v4.app.Fragmentバージョンもあるので、こっちを使ったほうがよさそう
• ver.24でいい感じの機能が追加されてるので、24以降を使いましょう Leanbackについてはこちらを https://developer.android.com/reference/android/support/v17/leanback/package-summary.html
Leanbackを使わない場合 • 超がんばる • TV App Qualityの基準に気をつけましょう • ゲームの場合はUnityとか使ってるアプリが多そう?
Demonstration
Thank you.