SlideShare a Scribd company logo
1 of 32
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

What's hot

OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
Paris Open Source Summit
 
Android introduction and rooting technology
Android introduction and rooting technologyAndroid introduction and rooting technology
Android introduction and rooting technology
Gagandeep Nanda
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash Development
Stephen Chin
 
Android on IA devices and Intel Tools
Android on IA devices and Intel ToolsAndroid on IA devices and Intel Tools
Android on IA devices and Intel Tools
Xavier Hallade
 

What's hot (20)

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

Viewers also liked

EuroSTAR 2013 Albert Witteveen Final
EuroSTAR 2013 Albert Witteveen FinalEuroSTAR 2013 Albert Witteveen Final
EuroSTAR 2013 Albert Witteveen Final
Albert Witteveen
 
Présentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM WatsonPrésentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM Watson
BeMyApp
 

Viewers also liked (20)

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

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

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform Anatomy
Benjamin Zores
 

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

Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
 
Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...
 
Android development
Android developmentAndroid development
Android development
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Software training report
Software training reportSoftware training report
Software training report
 
Mobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDKMobile Web Apps and the Intel® XDK
Mobile Web Apps and the Intel® XDK
 
Embedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphoneEmbedded Android: Android beyond the smartphone
Embedded Android: Android beyond the smartphone
 
Android
Android Android
Android
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform Anatomy
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphone
 
Developing Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDEDeveloping Multi-OS Native Mobile Applications with Intel INDE
Developing Multi-OS Native Mobile Applications with Intel INDE
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
Multi-OS Engine Technology Overview
Multi-OS Engine Technology OverviewMulti-OS Engine Technology Overview
Multi-OS Engine Technology Overview
 
Android zensar
Android zensarAndroid zensar
Android zensar
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Getting your app on Android TV
Getting your app on Android TVGetting your app on Android TV
Getting your app on Android TV
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 

More from BeMyApp

More from BeMyApp (20)

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

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 

[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

  1. 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 />
  2. 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 />
  3. 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 />
  4. Recommendations are notifications with a specific group named “recommendation”
  5. Manual approval
  6. 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
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. Plug for the demo night for the live demos of Emulator and GPA 1min
  13. Plug for the demo night for the live demos of Emulator and GPA 1min