SlideShare a Scribd company logo
1 of 21
Download to read offline
Second-Screen
  Support in
 Android 4.2
    Copyright © 2013 CommonsWare, LLC
Who's On Second?
●   Auxiliary screen
●   Inconsistently available
●   Display-only (no touchscreen)
●   Not:
    –   Simply being on a TV (think OUYA)
    –   Devices with dual primary displays (SONY Tablet
        P)
                      Copyright © 2013 CommonsWare, LLC
The Wayback Machine
●   Android 1.0 through 2.3
    –   Generally nothing
    –   Sporadic device-specific support (e.g., HTC DROID
        Incredible and composite output)
●   Android 3.0 through 4.1
    –   Mirroring
    –   Some limited developer control (video players)
●   Android 4.2: Developer Control
                        Copyright © 2013 CommonsWare, LLC
Getting To Second
●   HDMI
●   Mobile High-Definition Link (MHL)
●   Proprietary Cable
●   Miracast
    –   WifiDirect-based display protocol
    –   “Samsung All-Share Cast” on select Galaxy devices
    –   Added to core OS in Android 4.2, seen on Nexus 4

                        Copyright © 2013 CommonsWare, LLC
Not All Screens Are Created Equal
●   Key Differences
    –   Size (720p, 1080p, etc.)
    –   Density (tvdpi, hdpi, etc.)
●   Net: Different Context for Different Display
    –   Inflate layouts, load resources, etc. using proper
        Context to get the right ones for the targeted
        display

                       Copyright © 2013 CommonsWare, LLC
I Can Haz Second Screen?
●   DisplayManager
    –   System service (DISPLAY_SERVICE)
    –   getDisplays() (all or those in a category, like
        DISPLAY_CATEGORY_PRESENTATION)
    –   registerDisplayListener() to find out
        about changes in mix of displays
    –   New to API Level 17


                      Copyright © 2013 CommonsWare, LLC
I Can Haz Second Screen?
●   MediaRouter
    –   System service (MEDIA_ROUTER_SERVICE)
    –   More general: find preferred “route” for audio or
        video
    –   getSelectedRoute() to find the route to be
        used right now (ROUTE_TYPE_LIVE_VIDEO)
    –   addCallback() to find out route changes
    –   Added in API Level 16
                       Copyright © 2013 CommonsWare, LLC
Presentation: Getting Meta
●   Presentation
    –   Subclass of Dialog, added in API Level 17
    –   Override onCreate(), call
        setContentView()
    –   Supplies Context suitable for use with
        designated Display
    –   When displayed using show(), appears on
        designated Display
                      Copyright © 2013 CommonsWare, LLC
No, I Can Haz Second Screen?
●   Testing Options
    –   Actual “second screen”
    –   Simulated secondary display
         ●   Developer Options → Simulate secondary displays
         ●   Works well with hardware, less so with x86 emulator




                          Copyright © 2013 CommonsWare, LLC
Copyright © 2013 CommonsWare, LLC
Copyright © 2013 CommonsWare, LLC
Ack! Too Many Options!
●   Must Have Second Screen
    –   Presentation-specific app
●   Optional, Dedicated UX
    –   Game using second screen for primary output,
        device screen for control surface and secondary
        output
●   Optional, Using Fragments
    –   Push stuff to second screen or show “inline”
                      Copyright © 2013 CommonsWare, LLC
Fragments of a Presentation
●   Good News!
    –   Presentation extends Dialog, so
        DialogFragment works
    –   DialogFragment supports either show-as-
        dialog or show-as-regular-fragment
●   Bad News!
    –   Since different Contexts, cannot use the same
        DialogFragment instance for each
                      Copyright © 2013 CommonsWare, LLC
Copyright © 2013 CommonsWare, LLC
A Modicum of Control, Please
●   Second Screen: Not a Touchscreen
    –   Whatever shows on second screen is driven and
        controlled by what is on the primary screen
●   Example: Video Player
    –   Second screen shows the video playback
    –   Primary screen has play/pause, fast-forward,
        rewind, SeekBar, IMDB content, chat screen, etc.

                      Copyright © 2013 CommonsWare, LLC
A Modicum of Control, Please
●   Separate Fragments/Views
    –   One for what is shown
    –   One for controlling what is shown
●   Mirroring Content
    –   Same fragment/view, shown on both displays,
        controlled by primary screen




                        Copyright © 2013 CommonsWare, LLC
Present Imperfect
●   Activity-Based
    –   Presentation extends Dialog, must have an
        activity to show a Dialog
    –   Cannot have second screen driven by service,
        with primary screen running something
        independent
    –   Samsung, multi-window apps, and second
        screens?

                      Copyright © 2013 CommonsWare, LLC
Present Imperfect
●   Activity-Based
    –   Must dismiss() Presentation as part of
        switching to a new activity → flicker
         ●   Briefly shows mirroring before new Presentation
             appears
    –   Similar flicker if you try switching from one
        Presentation to another


                         Copyright © 2013 CommonsWare, LLC
Odd Possibilities
●   Exercise Equipment
    –   Equipment screen serves as external display for
        Android device
●   Smart Watches
    –   Miracast to monitors, TVs, etc., with watch face
        serving as control surface



                      Copyright © 2013 CommonsWare, LLC
Predictions, Sure To Go Wrong
●   Demise of Google TV
    –   Greater emphasis on Miracast and kin
    –   Parts cost cheaper for TVs
●   Wireless Display Standards Fight
    –   Apple AirPlay Mirroring, WiDi, WirelessHD, etc.
●   Manufacturers Pushing the Envelope
    –   Samsung and a multi-window extension
                      Copyright © 2013 CommonsWare, LLC
Q&A

Copyright © 2013 CommonsWare, LLC

More Related Content

What's hot

iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
Jacky Lian
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
瑋琮 林
 

What's hot (20)

jaringan tulang
jaringan tulangjaringan tulang
jaringan tulang
 
Android Jetpack
Android Jetpack Android Jetpack
Android Jetpack
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
 
Biologi - SEL (hewan dan tumbuhan) Bab 1
Biologi - SEL (hewan dan tumbuhan) Bab 1Biologi - SEL (hewan dan tumbuhan) Bab 1
Biologi - SEL (hewan dan tumbuhan) Bab 1
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
 
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
 
Android Fragment
Android FragmentAndroid Fragment
Android Fragment
 
Microservicios, sin morir en el intento
Microservicios, sin morir en el intentoMicroservicios, sin morir en el intento
Microservicios, sin morir en el intento
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
 
Android ppt
Android pptAndroid ppt
Android ppt
 
OpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIsOpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIs
 
Abstract Class and Interface in PHP
Abstract Class and Interface in PHPAbstract Class and Interface in PHP
Abstract Class and Interface in PHP
 
Secured Mobile Application Development in Android, Blackberry & iOS
Secured Mobile Application Development in Android, Blackberry & iOSSecured Mobile Application Development in Android, Blackberry & iOS
Secured Mobile Application Development in Android, Blackberry & iOS
 
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1Camera2 API, SHIM, and HAL 3.2 in Android 5.1
Camera2 API, SHIM, and HAL 3.2 in Android 5.1
 
Saminar ppt of
Saminar ppt ofSaminar ppt of
Saminar ppt of
 
Apple iOS Report
Apple iOS ReportApple iOS Report
Apple iOS Report
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptx
 
04 activities and activity life cycle
04 activities and activity life cycle04 activities and activity life cycle
04 activities and activity life cycle
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 

Viewers also liked

Viewers also liked (20)

Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
Design Multiple Screen android
Design Multiple Screen androidDesign Multiple Screen android
Design Multiple Screen android
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in android
 
[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...
[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...
[Android Codefest] Using the Second-Screen API & Intel® Wireless Display From...
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native Activity
 
Investigation report on 64 bit support in Android Open Source Project
Investigation report on 64 bit support in Android Open Source ProjectInvestigation report on 64 bit support in Android Open Source Project
Investigation report on 64 bit support in Android Open Source Project
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Logging system of Android
Logging system of AndroidLogging system of Android
Logging system of Android
 
IOMX in Android
IOMX in AndroidIOMX in Android
IOMX in Android
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
64-bit Android
64-bit Android64-bit Android
64-bit Android
 
Screen orientations in android
Screen orientations in androidScreen orientations in android
Screen orientations in android
 
Guide to Open Source Compliance
Guide to Open Source ComplianceGuide to Open Source Compliance
Guide to Open Source Compliance
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Practical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacksPractical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacks
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
PRESENTATION ON MIRROR LINK
PRESENTATION ON MIRROR LINKPRESENTATION ON MIRROR LINK
PRESENTATION ON MIRROR LINK
 
Building AR and VR Experiences
Building AR and VR ExperiencesBuilding AR and VR Experiences
Building AR and VR Experiences
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 

Similar to Second-Screen Support in Android 4.2

Optimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market DevicesOptimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market Devices
Motorola Mobility - MOTODEV
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screen
Heinrich Seeger
 
Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
CommonsWare
 

Similar to Second-Screen Support in Android 4.2 (20)

Google TV For Fun
Google TV For FunGoogle TV For Fun
Google TV For Fun
 
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot ViewAndroid Development: The 20,000-Foot View
Android Development: The 20,000-Foot View
 
Google TV: Thoughts From Left Field
Google TV: Thoughts From Left FieldGoogle TV: Thoughts From Left Field
Google TV: Thoughts From Left Field
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile Web
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly Bean
 
Android Development...The 20,000-Foot View
Android Development...The 20,000-Foot ViewAndroid Development...The 20,000-Foot View
Android Development...The 20,000-Foot View
 
App Integration (Revised and Updated)
App Integration (Revised and Updated)App Integration (Revised and Updated)
App Integration (Revised and Updated)
 
Backwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and TacticsBackwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and Tactics
 
Android Development Tutorial V3
Android Development Tutorial   V3Android Development Tutorial   V3
Android Development Tutorial V3
 
Videogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha TouchVideogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha Touch
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of Wearables
 
Optimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market DevicesOptimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market Devices
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screen
 
Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and Jetpack
 
X Means Y
X Means YX Means Y
X Means Y
 
Lecture 01: Introduction into Android.pptx
Lecture 01: Introduction into Android.pptxLecture 01: Introduction into Android.pptx
Lecture 01: Introduction into Android.pptx
 
App integration: Strategies and Tactics
App integration: Strategies and TacticsApp integration: Strategies and Tactics
App integration: Strategies and Tactics
 
Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail Pattern
 

More from CommonsWare

Tuning Android Applications (Part One)
Tuning Android Applications (Part One)Tuning Android Applications (Part One)
Tuning Android Applications (Part One)
CommonsWare
 

More from CommonsWare (17)

When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable AppsWhen Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable Apps
 
The Action Bar: Front to Back
The Action Bar: Front to BackThe Action Bar: Front to Back
The Action Bar: Front to Back
 
Android Security: Defending Your Users
Android Security: Defending Your UsersAndroid Security: Defending Your Users
Android Security: Defending Your Users
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful Threading
 
Maps V2... And You!
Maps V2... And You!Maps V2... And You!
Maps V2... And You!
 
A Deep Dive Into ViewPager
A Deep Dive Into ViewPagerA Deep Dive Into ViewPager
A Deep Dive Into ViewPager
 
Integrate Android Apps and Web Apps
Integrate Android Apps and Web AppsIntegrate Android Apps and Web Apps
Integrate Android Apps and Web Apps
 
Securing User Data with SQLCipher
Securing User Data with SQLCipherSecuring User Data with SQLCipher
Securing User Data with SQLCipher
 
Beaming Data to Devices with NFC
Beaming Data to Devices with NFCBeaming Data to Devices with NFC
Beaming Data to Devices with NFC
 
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business ModelsMaking Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business Models
 
AppsWorld Keynote
AppsWorld KeynoteAppsWorld Keynote
AppsWorld Keynote
 
Rich Text Editing and Beyond
Rich Text Editing and BeyondRich Text Editing and Beyond
Rich Text Editing and Beyond
 
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddAndroid Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
 
If I Were Starting Now
If I Were Starting NowIf I Were Starting Now
If I Were Starting Now
 
Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)
 
Tuning Android Applications (Part One)
Tuning Android Applications (Part One)Tuning Android Applications (Part One)
Tuning Android Applications (Part One)
 
Android Library Projects
Android Library ProjectsAndroid Library Projects
Android Library Projects
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Second-Screen Support in Android 4.2

  • 1. Second-Screen Support in Android 4.2 Copyright © 2013 CommonsWare, LLC
  • 2. Who's On Second? ● Auxiliary screen ● Inconsistently available ● Display-only (no touchscreen) ● Not: – Simply being on a TV (think OUYA) – Devices with dual primary displays (SONY Tablet P) Copyright © 2013 CommonsWare, LLC
  • 3. The Wayback Machine ● Android 1.0 through 2.3 – Generally nothing – Sporadic device-specific support (e.g., HTC DROID Incredible and composite output) ● Android 3.0 through 4.1 – Mirroring – Some limited developer control (video players) ● Android 4.2: Developer Control Copyright © 2013 CommonsWare, LLC
  • 4. Getting To Second ● HDMI ● Mobile High-Definition Link (MHL) ● Proprietary Cable ● Miracast – WifiDirect-based display protocol – “Samsung All-Share Cast” on select Galaxy devices – Added to core OS in Android 4.2, seen on Nexus 4 Copyright © 2013 CommonsWare, LLC
  • 5. Not All Screens Are Created Equal ● Key Differences – Size (720p, 1080p, etc.) – Density (tvdpi, hdpi, etc.) ● Net: Different Context for Different Display – Inflate layouts, load resources, etc. using proper Context to get the right ones for the targeted display Copyright © 2013 CommonsWare, LLC
  • 6. I Can Haz Second Screen? ● DisplayManager – System service (DISPLAY_SERVICE) – getDisplays() (all or those in a category, like DISPLAY_CATEGORY_PRESENTATION) – registerDisplayListener() to find out about changes in mix of displays – New to API Level 17 Copyright © 2013 CommonsWare, LLC
  • 7. I Can Haz Second Screen? ● MediaRouter – System service (MEDIA_ROUTER_SERVICE) – More general: find preferred “route” for audio or video – getSelectedRoute() to find the route to be used right now (ROUTE_TYPE_LIVE_VIDEO) – addCallback() to find out route changes – Added in API Level 16 Copyright © 2013 CommonsWare, LLC
  • 8. Presentation: Getting Meta ● Presentation – Subclass of Dialog, added in API Level 17 – Override onCreate(), call setContentView() – Supplies Context suitable for use with designated Display – When displayed using show(), appears on designated Display Copyright © 2013 CommonsWare, LLC
  • 9. No, I Can Haz Second Screen? ● Testing Options – Actual “second screen” – Simulated secondary display ● Developer Options → Simulate secondary displays ● Works well with hardware, less so with x86 emulator Copyright © 2013 CommonsWare, LLC
  • 10. Copyright © 2013 CommonsWare, LLC
  • 11. Copyright © 2013 CommonsWare, LLC
  • 12. Ack! Too Many Options! ● Must Have Second Screen – Presentation-specific app ● Optional, Dedicated UX – Game using second screen for primary output, device screen for control surface and secondary output ● Optional, Using Fragments – Push stuff to second screen or show “inline” Copyright © 2013 CommonsWare, LLC
  • 13. Fragments of a Presentation ● Good News! – Presentation extends Dialog, so DialogFragment works – DialogFragment supports either show-as- dialog or show-as-regular-fragment ● Bad News! – Since different Contexts, cannot use the same DialogFragment instance for each Copyright © 2013 CommonsWare, LLC
  • 14. Copyright © 2013 CommonsWare, LLC
  • 15. A Modicum of Control, Please ● Second Screen: Not a Touchscreen – Whatever shows on second screen is driven and controlled by what is on the primary screen ● Example: Video Player – Second screen shows the video playback – Primary screen has play/pause, fast-forward, rewind, SeekBar, IMDB content, chat screen, etc. Copyright © 2013 CommonsWare, LLC
  • 16. A Modicum of Control, Please ● Separate Fragments/Views – One for what is shown – One for controlling what is shown ● Mirroring Content – Same fragment/view, shown on both displays, controlled by primary screen Copyright © 2013 CommonsWare, LLC
  • 17. Present Imperfect ● Activity-Based – Presentation extends Dialog, must have an activity to show a Dialog – Cannot have second screen driven by service, with primary screen running something independent – Samsung, multi-window apps, and second screens? Copyright © 2013 CommonsWare, LLC
  • 18. Present Imperfect ● Activity-Based – Must dismiss() Presentation as part of switching to a new activity → flicker ● Briefly shows mirroring before new Presentation appears – Similar flicker if you try switching from one Presentation to another Copyright © 2013 CommonsWare, LLC
  • 19. Odd Possibilities ● Exercise Equipment – Equipment screen serves as external display for Android device ● Smart Watches – Miracast to monitors, TVs, etc., with watch face serving as control surface Copyright © 2013 CommonsWare, LLC
  • 20. Predictions, Sure To Go Wrong ● Demise of Google TV – Greater emphasis on Miracast and kin – Parts cost cheaper for TVs ● Wireless Display Standards Fight – Apple AirPlay Mirroring, WiDi, WirelessHD, etc. ● Manufacturers Pushing the Envelope – Samsung and a multi-window extension Copyright © 2013 CommonsWare, LLC
  • 21. Q&A Copyright © 2013 CommonsWare, LLC