SlideShare a Scribd company logo
Developing for Android TV
Mihai Risca, Application Engineer,
Software & Services Group
Developer Relations Division
2
Agenda
• What are Android TV and the Nexus Player
• How to create/adapt an Android application for Android TV
• How to publish an Android TV application
• Optimizing applications for the Nexus Player
• Q&A
Android TV and the Nexus Player
4
Android TV
• It’s Android
• it’s also Chromecast
• Apps (streaming and others)
• Games (casual and more)
• AOSP compliant
• Leanback Launcher, Google Apps and Play Store
5
Nexus Player
• First Android TV device / The only Nexus
• Quad-Core Intel Silvermont CPU @1.83Ghz
• PowerVR™ Series 6 G6430 GPU
• 64bit, OpenGL ES 3.1
• WiFi 802.11ac*
• 1GB ram, 8GB flash, USB-OTG
• 99$
• Gamepad sold separately**
* Ethernet can be added using standard USB adapters
** Android TV supports almost any USB/Bluetooth HID Gamepads
Developing for Android TV and the Nexus Player
7
Developing for Android TV
Create a new Android application or add support to an existing one by:
1. Adding/reusing a TV-compatible activity that will receive the leanback intent
2. Integrating TV-specific assets
3. Supporting non-touchscreen input
4. Adapting the UX of your app to Android TV
All this should be done to an existing Android app, so you can support phones,
tablets, and TVs from your same source code and APK.
You can still choose to create a TV-specific APK and upload it as a new
application or as an alternative APK using Play Store “multiple APKs” feature.
8
1. The Leanback Intent
<activity android:name=".TvMainActivity“ >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LEANBACK_LAUNCHER"
/>
</intent-filter>
</activity>
9
2. The Banner
<activity or <application
…
android:banner="@drawable/ic_banner"
…
>
• Name of your application
• No transparency
• Size:160x90dp -> 320x180px image to put inside drawable-xhdpi folder.
10
3. Supporting non-touchscreen input
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
Adjust D-PAD navigation:
android:focusable="true", <requestFocus /> / .requestFocus()
android:nextFocusDown="@+id/whatever1"
android:nextFocusUp="@id/whatever2"
For custom Views: KeyEvent.KEYCODE_DPAD_(UP|DOWN|LEFT|RIGHT)
11
4. Adapting the UX
Start from android:Theme.NoTitleBar
Or Theme.Leanback from the Leanback support library:
compile "com.android.support:leanback-v17:21.0.+“
Add overscan margins to your views: (Leanback Views and Fragments already have these)
android:layout_marginTop="27dp"
android:layout_marginLeft="48dp"
android:layout_marginRight="48dp"
android:layout_marginBottom="27dp"
Note: Leanback support library requires API 17 but you can still support lower API levels
from your app:
• Use Theme.Leanback from –v21 resource folders, use Leanback classes only from your
TV-part.
• Set <uses-sdk tools:overrideLibrary="android.support.v17.leanback" />
12
Going further
 Using ready-to-use elements from the Leanback Support Library
 Supporting multiple controllers
 Integrating the recommendation system
 Integrating the search system
Publishing apps to the Android TV Play Store
14
Play Store additional requirements
Is your app a Game ?
<android:isGame="true">
Supporting Gamepads ?
<uses-feature android:name="android.hardware.gamepad“ android:required="false" />
Supporting only Android TV ?
<uses-feature android:name="android.software.leanback" android:required="true" />
15
A classic trap: implicitly required features
Having portrait activities declared inside your app ? Need to specify that your app can be used on
hardware that doesn’t support “portrait” mode:
<uses-feature android:name="android.hardware.screen.portrait“ android:required="false" />
Use of certain permissions also implicitly requires hardware features that aren’t available:
• android.hardware.location implied by android.permission.ACCESS_FINE_LOCATION
• android.hardware.camera.autofocus and android.hardware.camera implied
by android.permission.CAMERA
• android.hardware.microphone implied by android.permission.RECORD_AUDIO
• android.hardware.telephony implied by many telephony-specific permissions
16
Submitting your application
1. Check you’re compliant with all the guidelines
2. Upload your APK
3. Upload your banner and a screenshot
4. Opt-in for distribution to the Play Store on Android TV
Optimizing apps for the Nexus Player
18
Android* Devices with Intel Inside
(Some of them – there are more than hundred, not all could be listed here)
Motorola*
RAZR i
ZTE* Grand
X IN
Lava* Xolo
X900
Megafon*
Mint
Lenovo*
K800
Orange*
San Diego
2012, 2013…
Lenovo* K900 ASUS
Fonepad™ Note
FHD - 6”
ZTE* Geek Samsung* Galaxy™ Tab 3 10.1”
2014… Asus* Zenfones 4/5/6 ASUS* Transformer Pad
TF103CG/TF303CL
Dell* Venue 8 7000
Intel® Yolo Acer* Liquid C1Etisalat E-20*
ASUS* MeMO Pad
FHD 10
ASUS* Fonepad™ 7” Dell* Venue 7/8
KD Interactive
Kurio Tablet Toshiba
Excite Go
Acer* Iconia Tab 8
/ One 8
Nexus PlayerLenovo* S8Asus* MemoPad 7/8
Asus* FonePad 7/8
Lenovo Yoga Tab 2
8/10/13
Tesco Hudl 2
19
These devices are all fully compatible with Android*
ARM* ecosystem
Android* SDK apps
− These will directly work. We’re optimizing the
Runtimes for Intel® platforms.
Android* NDK apps
− Most will run without any recompilation on consumer platforms.
− Android NDK provides an x86 toolchain since 2011
− A simple recompile using the Android NDK yields the best performance
− If there is specific processor dependent code, porting may be necessary
Android Runtime
Core Libraries
DVM / ART
20
3rd party libraries/engines x86 support
• Game engines/libraries with x86 support:
• Havok Anarchy SDK: android x86 target available
• Unreal Engine 3: android x86 target available
• Marmalade: android x86 target available
• NexPlayer SDK: x86 supported by default in latest releases
• Cocos2Dx: set APP_ABI in Application.mk
• FMOD: x86 lib already included, set ABIs in Application.mk
• AppGameKit: x86 lib included, set ABIs in Application.mk
• libgdx: x86 supported by default in latest releases
• AppPortable: x86 support now available
• Adobe Air: x86 support now available
• Unity: x86 support available in 5.0 beta, soon-to-be released for earlier versions
• …
21
Include all ABIs by setting APP_ABI to all in jni/Application.mk:
APP_ABI=all
The NDK will generate optimized code for all target ABIs
You can also pass APP_ABI variable to ndk-build, and specify each ABI:
ndk-build APP_ABI=x86 #all32 and all64 are also possible values.
Configuring NDK Target ABIs
Build ARM64 libs
Build x86_64 libs
Build mips64 libs
Build ARMv7a libs
Build ARMv5 libs
Build x86 libs
Build mips libs
22
“Fat” APKs
By default, an APK contains libraries for every supported ABIs.
Install lib/armeabi-v7a libs
Install lib/x86 libs
Install lib/x86_64 libraries
libs/x86
libs/x86_64
APK file
…
Libs for the selected ABI are installed, the others remain inside the downloaded APK
… … …
libs/armeabi-v7a
23
Multiple APKs
Google Play* supports multiple APKs for the same application.
What compatible APK will be chosen for a device entirely depends on the
android:versionCode
If you have multiple APKs for multiple ABIs, best is to simply prefix your current
version code with a digit representing the ABI:
2310 3310 6310 7310
You can have more options for multiple APKs, here is a convention that will
work if you’re using all of these:
x86ARMv7 ARM64 X86_64
24
Multiple APKs – clean solution with gradle
splits {
abi {
enable true
reset()
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
universalApk true
}
}
// map for the version code
project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5,
'mips64': 6, 'x86': 8, 'x86_64': 9]
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
output.versionCodeOverride =
project.ext.versionCodes.get(output.abiFilter, 0) * 1000000 +
android.defaultConfig.versionCode
}
}
25
Uploading Multiple APKs to the store
Switch to Advanced mode before
uploading the second APK.
Intel® Tools for Android* apps developers
HAXM, INDE, System Studio, XDK…
27
Intel x86
Emulator
Accelerator
Intel x86 Atom
System Image
Faster Android* Emulation on Intel® Architecture
Based Host PC
• Pre-built Intel® Atom™ Processor Images
available through the Android* SDK manager
• Intel® Hardware Accelerated Execution
Manager (Intel® HAXM) for Mac and Windows
uses Intel® Virtualization Technology (Intel® VT)
to accelerate Android emulator
• Intel® VT is already supported in Linux* by kvm
kernel driver
28
Intel INDE
28
Increasing productivity at every step along the development chain
A productivity tool built with today’s developer in mind.
 IDE support: Eclipse*, Microsoft Visual Studio*
 Host support: Microsoft Windows* 7-8.1
 Target support: Android 4.3 & up devices on ARM* and Intel®
Architecture, Microsoft Windows* 7-8.1 devices on Intel®
Architecture
Environment set-up & maintenance
Analyze & Debug ShipCompileCreate
 Frame Debugger
 System Analyzer
 Platform Analyzer
 Frame Analyzer
 Compute Code
Builder
 Android Versions 4.3
& up, Intel®
Architecture & ARM*
devices.
 Microsoft Windows*
7-8.1 Intel®
Architecture devices
 GNU C++
Compiler
 Intel® C++
Compiler
 Compute Code
Builder
 Media
 Threading
 Compute Code
Builder
Download: intel.com/software/inde
29
For on-device app testing: Intel®
GPA System Analyzer
Real-time Remote Performance and Power Profiling
Intel® GPA
System Analyzer
running on a PC
Android
Device
USB adb Connection
Wi-Fi adb Connection
Data
Real-time charts:
• CPU metrics
• Graphics API level metrics
• Processor graphics hardware metrics
• Power metrics
Download Intel® GPA for FREE at intel.com/software/GPA
30
Debugging OpenGL ES code with Frame Debugger
Download Intel® GPA for FREE at intel.com/software/GPA
31
Summary
• Apps submission started only on November 3rd
(good opportunity to bring more visibility to your apps and games)
• Adding Android TV support isn’t necessarily much work
• No need for maintaining a separate APK
• Better x86 apps compatibility is nice to have for your apps/libs/engines
• Intel provides powerful tool suites for Android development
Q&A

More Related Content

PDF
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
PDF
[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...
PDF
Second-Screen Support in Android 4.2
PDF
Droidcon2013 miracast final2
PDF
Secondary Screen Support Using DisplayManager
PPTX
Android Meetup, Илья Лёвин
PDF
The unconventional devices for the video streaming in Android
PPT
Google tv
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...
Second-Screen Support in Android 4.2
Droidcon2013 miracast final2
Secondary Screen Support Using DisplayManager
Android Meetup, Илья Лёвин
The unconventional devices for the video streaming in Android
Google tv

What's hot (20)

PDF
Enlarge your screen: introducing the Google TV
PDF
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
PDF
ExoPlayer for Application developers
PPTX
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
PDF
Tizen Window System
PDF
Video Streaming: from the native Android player to uncoventional devices
PDF
Movi presentation Singapore video tech meetup
PDF
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
PDF
Getting Android Developers for Your Wearables
PDF
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
PDF
Android Automotive
PDF
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
PDF
ODP
Ubuntu touch
PDF
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
PPT
Android introduction and rooting technology
PDF
Android's Multimedia Framework
PPTX
Android Flash Development
PDF
Android on IA devices and Intel Tools
Enlarge your screen: introducing the Google TV
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ExoPlayer for Application developers
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
Tizen Window System
Video Streaming: from the native Android player to uncoventional devices
Movi presentation Singapore video tech meetup
Debug, Analyze and Optimize Games with Intel Tools - Matteo Valoriani - Codem...
Getting Android Developers for Your Wearables
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Android Automotive
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
Ubuntu touch
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Android introduction and rooting technology
Android's Multimedia Framework
Android Flash Development
Android on IA devices and Intel Tools
Ad

Viewers also liked (20)

PPTX
EuroSTAR 2013 Albert Witteveen Final
ODP
Seminar nasional internet of things 2016
PPTX
Best Practices For Sharing Data Across The Enteprrise
PDF
Cisco Paris DevNet Hackathon slideshow - Intro
PPTX
Présentation des APIs cognitives IBM Watson
PPTX
SplunkLive! Utrecht - Splunk for IT Operations - Rick Fitz
PPTX
SplunkLive! Utrecht - Splunk for Security - Monzy Merza
PPTX
SplunkLive! Utrecht 2016 - NXP
PPTX
Getting Started with Splunk Enterprise
PPTX
Gartner Datacenter Summit - Cox Automotive
PPTX
Splunk in integration testing
PPTX
SplunkLive! Utrecht - Keynote - Rick Fitz
PPTX
How to Design, Build and Map IT and Business Services in Splunk
PDF
Getting Started with Splunk Hands-on
PDF
Splunk Enterprise for IT Troubleshooting Hands-On
PDF
Getting Started with IT Service Intelligence
PDF
Experian Customer Presentation
PPTX
Wie Sie Ransomware aufspüren und was Sie dagegen machen können
PPTX
Delivering business value from operational insights at ING Bank
PPTX
Threat Hunting with Splunk
EuroSTAR 2013 Albert Witteveen Final
Seminar nasional internet of things 2016
Best Practices For Sharing Data Across The Enteprrise
Cisco Paris DevNet Hackathon slideshow - Intro
Présentation des APIs cognitives IBM Watson
SplunkLive! Utrecht - Splunk for IT Operations - Rick Fitz
SplunkLive! Utrecht - Splunk for Security - Monzy Merza
SplunkLive! Utrecht 2016 - NXP
Getting Started with Splunk Enterprise
Gartner Datacenter Summit - Cox Automotive
Splunk in integration testing
SplunkLive! Utrecht - Keynote - Rick Fitz
How to Design, Build and Map IT and Business Services in Splunk
Getting Started with Splunk Hands-on
Splunk Enterprise for IT Troubleshooting Hands-On
Getting Started with IT Service Intelligence
Experian Customer Presentation
Wie Sie Ransomware aufspüren und was Sie dagegen machen können
Delivering business value from operational insights at ING Bank
Threat Hunting with Splunk
Ad

Similar to [Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV (20)

PDF
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
PDF
Android on Intel platforms : current state, near-future, future & developers ...
PPTX
Android development
PPT
Introduction to android sessions new
PDF
Software training report
PPTX
Mobile Web Apps and the Intel® XDK
PDF
Embedded Android: Android beyond the smartphone
PDF
Droidcon 2013 France - Android Platform Anatomy
PDF
Android beyond the smartphone
PDF
Developing Multi-OS Native Mobile Applications with Intel INDE
PDF
Droidcon uk2012 androvm
PPTX
Multi-OS Engine Technology Overview
PPTX
Chapter 2-IS dept.pptxhjvcbtffffffffffffffffffffffffffff6
PDF
Android dev o_auth
PPTX
Getting started with the NDK
PPTX
Developing for Android-Types of Android Application
PPTX
Seminar on android app development
PDF
Getting your app on Android TV
PPTX
Android Applications Development: A Quick Start Guide
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Android on Intel platforms : current state, near-future, future & developers ...
Android development
Introduction to android sessions new
Software training report
Mobile Web Apps and the Intel® XDK
Embedded Android: Android beyond the smartphone
Droidcon 2013 France - Android Platform Anatomy
Android beyond the smartphone
Developing Multi-OS Native Mobile Applications with Intel INDE
Droidcon uk2012 androvm
Multi-OS Engine Technology Overview
Chapter 2-IS dept.pptxhjvcbtffffffffffffffffffffffffffff6
Android dev o_auth
Getting started with the NDK
Developing for Android-Types of Android Application
Seminar on android app development
Getting your app on Android TV
Android Applications Development: A Quick Start Guide

More from BeMyApp (20)

PPTX
Introduction to epid
PDF
Introduction ciot workshop premeetup
PDF
Crédit Agricole S.A. Personae et Parcours
PPTX
Tumeurs Neuroendocrines : une vue d'ensemble
PPTX
Building your first game in Unity 3d by Sarah Sexton
PDF
Using intel's real sense to create games with natural user interfaces justi...
PPTX
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
PPTX
Audio Mixer in Unity5 - Andy Touch
PDF
Shaders - Claudia Doppioslash - Unity With the Best
PDF
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
PDF
Tools to Save Time
PDF
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
PDF
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
PPTX
[IoT World Forum Webinar] Review of CMX Cisco technology
PDF
HP Helion Episode 6: Cloud Foundry Summit Recap
PDF
Webinar UI/UX by Francesco Marcellino
PDF
HP Helion Webinar #5 - Security Beyond Firewalls
PDF
HP Helion Webinar #4 - Open stack the magic pill
PDF
HP Helion European Webinar Series ,Webinar #3
PDF
HP Helion Webinar #2
Introduction to epid
Introduction ciot workshop premeetup
Crédit Agricole S.A. Personae et Parcours
Tumeurs Neuroendocrines : une vue d'ensemble
Building your first game in Unity 3d by Sarah Sexton
Using intel's real sense to create games with natural user interfaces justi...
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
Audio Mixer in Unity5 - Andy Touch
Shaders - Claudia Doppioslash - Unity With the Best
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
Tools to Save Time
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
[IoT World Forum Webinar] Review of CMX Cisco technology
HP Helion Episode 6: Cloud Foundry Summit Recap
Webinar UI/UX by Francesco Marcellino
HP Helion Webinar #5 - Security Beyond Firewalls
HP Helion Webinar #4 - Open stack the magic pill
HP Helion European Webinar Series ,Webinar #3
HP Helion Webinar #2

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Monthly Chronicles - July 2025
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV

  • 1. Developing for Android TV Mihai Risca, Application Engineer, Software & Services Group Developer Relations Division
  • 2. 2 Agenda • What are Android TV and the Nexus Player • How to create/adapt an Android application for Android TV • How to publish an Android TV application • Optimizing applications for the Nexus Player • Q&A
  • 3. Android TV and the Nexus Player
  • 4. 4 Android TV • It’s Android • it’s also Chromecast • Apps (streaming and others) • Games (casual and more) • AOSP compliant • Leanback Launcher, Google Apps and Play Store
  • 5. 5 Nexus Player • First Android TV device / The only Nexus • Quad-Core Intel Silvermont CPU @1.83Ghz • PowerVR™ Series 6 G6430 GPU • 64bit, OpenGL ES 3.1 • WiFi 802.11ac* • 1GB ram, 8GB flash, USB-OTG • 99$ • Gamepad sold separately** * Ethernet can be added using standard USB adapters ** Android TV supports almost any USB/Bluetooth HID Gamepads
  • 6. Developing for Android TV and the Nexus Player
  • 7. 7 Developing for Android TV Create a new Android application or add support to an existing one by: 1. Adding/reusing a TV-compatible activity that will receive the leanback intent 2. Integrating TV-specific assets 3. Supporting non-touchscreen input 4. Adapting the UX of your app to Android TV All this should be done to an existing Android app, so you can support phones, tablets, and TVs from your same source code and APK. You can still choose to create a TV-specific APK and upload it as a new application or as an alternative APK using Play Store “multiple APKs” feature.
  • 8. 8 1. The Leanback Intent <activity android:name=".TvMainActivity“ > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> </intent-filter> </activity>
  • 9. 9 2. The Banner <activity or <application … android:banner="@drawable/ic_banner" … > • Name of your application • No transparency • Size:160x90dp -> 320x180px image to put inside drawable-xhdpi folder.
  • 10. 10 3. Supporting non-touchscreen input <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> Adjust D-PAD navigation: android:focusable="true", <requestFocus /> / .requestFocus() android:nextFocusDown="@+id/whatever1" android:nextFocusUp="@id/whatever2" For custom Views: KeyEvent.KEYCODE_DPAD_(UP|DOWN|LEFT|RIGHT)
  • 11. 11 4. Adapting the UX Start from android:Theme.NoTitleBar Or Theme.Leanback from the Leanback support library: compile "com.android.support:leanback-v17:21.0.+“ Add overscan margins to your views: (Leanback Views and Fragments already have these) android:layout_marginTop="27dp" android:layout_marginLeft="48dp" android:layout_marginRight="48dp" android:layout_marginBottom="27dp" Note: Leanback support library requires API 17 but you can still support lower API levels from your app: • Use Theme.Leanback from –v21 resource folders, use Leanback classes only from your TV-part. • Set <uses-sdk tools:overrideLibrary="android.support.v17.leanback" />
  • 12. 12 Going further  Using ready-to-use elements from the Leanback Support Library  Supporting multiple controllers  Integrating the recommendation system  Integrating the search system
  • 13. Publishing apps to the Android TV Play Store
  • 14. 14 Play Store additional requirements Is your app a Game ? <android:isGame="true"> Supporting Gamepads ? <uses-feature android:name="android.hardware.gamepad“ android:required="false" /> Supporting only Android TV ? <uses-feature android:name="android.software.leanback" android:required="true" />
  • 15. 15 A classic trap: implicitly required features Having portrait activities declared inside your app ? Need to specify that your app can be used on hardware that doesn’t support “portrait” mode: <uses-feature android:name="android.hardware.screen.portrait“ android:required="false" /> Use of certain permissions also implicitly requires hardware features that aren’t available: • android.hardware.location implied by android.permission.ACCESS_FINE_LOCATION • android.hardware.camera.autofocus and android.hardware.camera implied by android.permission.CAMERA • android.hardware.microphone implied by android.permission.RECORD_AUDIO • android.hardware.telephony implied by many telephony-specific permissions
  • 16. 16 Submitting your application 1. Check you’re compliant with all the guidelines 2. Upload your APK 3. Upload your banner and a screenshot 4. Opt-in for distribution to the Play Store on Android TV
  • 17. Optimizing apps for the Nexus Player
  • 18. 18 Android* Devices with Intel Inside (Some of them – there are more than hundred, not all could be listed here) Motorola* RAZR i ZTE* Grand X IN Lava* Xolo X900 Megafon* Mint Lenovo* K800 Orange* San Diego 2012, 2013… Lenovo* K900 ASUS Fonepad™ Note FHD - 6” ZTE* Geek Samsung* Galaxy™ Tab 3 10.1” 2014… Asus* Zenfones 4/5/6 ASUS* Transformer Pad TF103CG/TF303CL Dell* Venue 8 7000 Intel® Yolo Acer* Liquid C1Etisalat E-20* ASUS* MeMO Pad FHD 10 ASUS* Fonepad™ 7” Dell* Venue 7/8 KD Interactive Kurio Tablet Toshiba Excite Go Acer* Iconia Tab 8 / One 8 Nexus PlayerLenovo* S8Asus* MemoPad 7/8 Asus* FonePad 7/8 Lenovo Yoga Tab 2 8/10/13 Tesco Hudl 2
  • 19. 19 These devices are all fully compatible with Android* ARM* ecosystem Android* SDK apps − These will directly work. We’re optimizing the Runtimes for Intel® platforms. Android* NDK apps − Most will run without any recompilation on consumer platforms. − Android NDK provides an x86 toolchain since 2011 − A simple recompile using the Android NDK yields the best performance − If there is specific processor dependent code, porting may be necessary Android Runtime Core Libraries DVM / ART
  • 20. 20 3rd party libraries/engines x86 support • Game engines/libraries with x86 support: • Havok Anarchy SDK: android x86 target available • Unreal Engine 3: android x86 target available • Marmalade: android x86 target available • NexPlayer SDK: x86 supported by default in latest releases • Cocos2Dx: set APP_ABI in Application.mk • FMOD: x86 lib already included, set ABIs in Application.mk • AppGameKit: x86 lib included, set ABIs in Application.mk • libgdx: x86 supported by default in latest releases • AppPortable: x86 support now available • Adobe Air: x86 support now available • Unity: x86 support available in 5.0 beta, soon-to-be released for earlier versions • …
  • 21. 21 Include all ABIs by setting APP_ABI to all in jni/Application.mk: APP_ABI=all The NDK will generate optimized code for all target ABIs You can also pass APP_ABI variable to ndk-build, and specify each ABI: ndk-build APP_ABI=x86 #all32 and all64 are also possible values. Configuring NDK Target ABIs Build ARM64 libs Build x86_64 libs Build mips64 libs Build ARMv7a libs Build ARMv5 libs Build x86 libs Build mips libs
  • 22. 22 “Fat” APKs By default, an APK contains libraries for every supported ABIs. Install lib/armeabi-v7a libs Install lib/x86 libs Install lib/x86_64 libraries libs/x86 libs/x86_64 APK file … Libs for the selected ABI are installed, the others remain inside the downloaded APK … … … libs/armeabi-v7a
  • 23. 23 Multiple APKs Google Play* supports multiple APKs for the same application. What compatible APK will be chosen for a device entirely depends on the android:versionCode If you have multiple APKs for multiple ABIs, best is to simply prefix your current version code with a digit representing the ABI: 2310 3310 6310 7310 You can have more options for multiple APKs, here is a convention that will work if you’re using all of these: x86ARMv7 ARM64 X86_64
  • 24. 24 Multiple APKs – clean solution with gradle splits { abi { enable true reset() include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' universalApk true } } // map for the version code project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9] android.applicationVariants.all { variant -> // assign different version code for each output variant.outputs.each { output -> output.versionCodeOverride = project.ext.versionCodes.get(output.abiFilter, 0) * 1000000 + android.defaultConfig.versionCode } }
  • 25. 25 Uploading Multiple APKs to the store Switch to Advanced mode before uploading the second APK.
  • 26. Intel® Tools for Android* apps developers HAXM, INDE, System Studio, XDK…
  • 27. 27 Intel x86 Emulator Accelerator Intel x86 Atom System Image Faster Android* Emulation on Intel® Architecture Based Host PC • Pre-built Intel® Atom™ Processor Images available through the Android* SDK manager • Intel® Hardware Accelerated Execution Manager (Intel® HAXM) for Mac and Windows uses Intel® Virtualization Technology (Intel® VT) to accelerate Android emulator • Intel® VT is already supported in Linux* by kvm kernel driver
  • 28. 28 Intel INDE 28 Increasing productivity at every step along the development chain A productivity tool built with today’s developer in mind.  IDE support: Eclipse*, Microsoft Visual Studio*  Host support: Microsoft Windows* 7-8.1  Target support: Android 4.3 & up devices on ARM* and Intel® Architecture, Microsoft Windows* 7-8.1 devices on Intel® Architecture Environment set-up & maintenance Analyze & Debug ShipCompileCreate  Frame Debugger  System Analyzer  Platform Analyzer  Frame Analyzer  Compute Code Builder  Android Versions 4.3 & up, Intel® Architecture & ARM* devices.  Microsoft Windows* 7-8.1 Intel® Architecture devices  GNU C++ Compiler  Intel® C++ Compiler  Compute Code Builder  Media  Threading  Compute Code Builder Download: intel.com/software/inde
  • 29. 29 For on-device app testing: Intel® GPA System Analyzer Real-time Remote Performance and Power Profiling Intel® GPA System Analyzer running on a PC Android Device USB adb Connection Wi-Fi adb Connection Data Real-time charts: • CPU metrics • Graphics API level metrics • Processor graphics hardware metrics • Power metrics Download Intel® GPA for FREE at intel.com/software/GPA
  • 30. 30 Debugging OpenGL ES code with Frame Debugger Download Intel® GPA for FREE at intel.com/software/GPA
  • 31. 31 Summary • Apps submission started only on November 3rd (good opportunity to bring more visibility to your apps and games) • Adding Android TV support isn’t necessarily much work • No need for maintaining a separate APK • Better x86 apps compatibility is nice to have for your apps/libs/engines • Intel provides powerful tool suites for Android development
  • 32. Q&A

Editor's Notes

  • #5: And this is Android-Lollipop, you need to properly use JNI since ART is the only runtime and is more touchy than Dalvik. For D-pad navigation: use android:nextFocusUp Down Left Right in layout views use <requestFocus />
  • #6: And this is Android-Lollipop, you need to properly use JNI since ART is the only runtime and is more touchy than Dalvik. For D-pad navigation: use android:nextFocusUp Down Left Right in layout views use <requestFocus />
  • #12: And this is Android-Lollipop, you need to properly use JNI since ART is the only runtime and is more touchy than Dalvik. For D-pad navigation: use android:nextFocusUp Down Left Right in layout views use <requestFocus />
  • #13: Recommendations are notifications with a specific group named “recommendation”
  • #17: Manual approval
  • #19: First phone on the market was out in May 2012 This list isn’t exhaustive, there are even more devices available (more than 100) For dev platforms: Source Code and BSP: https://github.com/android-ia Builds and Documentation: https://01.org/android-ia MinnowBoard MAX: $99: Intel® Atom E3815 (single-core, 1.46 GHz) $129: Intel® Atom E3825 (dual-core, 1.33 GHz) Intel NUC DN2820FYKH 125 €: Intel® Celeron N2820 (dual-core, 2.13GHz) Dell Venue 8 7000 is the finest tablet as of now, with only 6mm
  • #22: If you include an application.mk file in your jni folder with all the CPU ABI then you can just run the script ndk-build with no arg.
  • #23: Credit: GDC presentation APP_ABI=“ x86 armeabi” can be also directly passed to the ndk-build command. APP_ABI=all also works to target all available binaries.
  • #24: For example, order the version codes so that the x86 APK has the highest version code, followed by ARMv7, then ARMv5TE. Thus x86 binaries will be preferred for x86 devices and ARMv7 binaries preferred for ARMv7 devices. Intel suggests using a version code with at least 8 digits. Integers that represent the supported configurations are in the higher order bits, and the version name (from android:versionName) is in the lower order bits. For example, when the application version name is 3.1.0, the recommended version code for ARMv7 ABI and an API level 11 APK would be 21100310. As another example, when the application version name is 3.1.0, version code for X86 and an API level 11 APK would be 61100310. The first digit indicates the supported ABI, the second and third digits are reserved for the API level, the fourth and fifth digits are for either screen sizes or GL texture formats (not used in these examples), and the last three digits are for the application's version number (3.1.0). Figure 1 shows two examples that are split based solely on the ABI with the same platform version (API Level), screen size, and application version. Source: developper.android.com Remember that downgrade isn’t supported ! That’s why having proper versioncode is really important.
  • #26: The APK information on the right will be the same if you are in advanced mode or simple mode. You can have the feeling it’s replacing your previous APK at this moment. In fact, if you are in advanced mode it will only be added to your APKs list as you want it.
  • #28: Intel works daily with Google to ensure things like our system images are linked to by the SDK Manager. Today we have Gingerbread, Ice Cream Sandwich, Jelly-Bean and KitKat system images available for the emulator. In February ‘12, we unveiled the Intel Hardware-Accelerated Execution Manager which speeds up Android emulation significantly for any Android developer using an IA-based host PC on Windows, Mac or Linux. Google was so impressed that they decided to show it off in their keynotes at the March Game Developer Conference and the May AnDevCon. Whether you’re coding in Dalvik Java or C/C++ (for NDK apps), and regardless of whether you’re targeting ARM or IA-based smartphones or tablets, this solution will deliver a far superior Android emulation experience for faster testing and debug of your Android apps.
  • #30: Plug for the demo night for the live demos of Emulator and GPA 1min
  • #31: Plug for the demo night for the live demos of Emulator and GPA 1min