SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on Android
Xavier Hallade
 
HUMAN COMPUTER INTERACTION
HUMAN COMPUTER INTERACTIONHUMAN COMPUTER INTERACTION
HUMAN COMPUTER INTERACTION
Javed Ahmed Samo
 
Touch Technology....ppt
Touch Technology....pptTouch Technology....ppt
Touch Technology....ppt
hashgeneration
 

Was ist angesagt? (20)

Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on Android
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming Seminar
 
Container based android
Container based androidContainer based android
Container based android
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1
 
G++ & GCC
G++ & GCCG++ & GCC
G++ & GCC
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
RTAI - Earliest Deadline First
RTAI - Earliest Deadline FirstRTAI - Earliest Deadline First
RTAI - Earliest Deadline First
 
Weather Display app
Weather Display appWeather Display app
Weather Display app
 
HUMAN COMPUTER INTERACTION
HUMAN COMPUTER INTERACTIONHUMAN COMPUTER INTERACTION
HUMAN COMPUTER INTERACTION
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Presentation linux on power
Presentation   linux on powerPresentation   linux on power
Presentation linux on power
 
Touch Technology....ppt
Touch Technology....pptTouch Technology....ppt
Touch Technology....ppt
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
PPT on MS-CIT Unit-2
PPT on MS-CIT Unit-2PPT on MS-CIT Unit-2
PPT on MS-CIT Unit-2
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatz
 
Kotlin coroutine - behind the scenes
Kotlin coroutine - behind the scenesKotlin coroutine - behind the scenes
Kotlin coroutine - behind the scenes
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von CommonsWare

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

Mehr von 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
 

Kürzlich hochgeladen

+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@
 
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
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
"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 ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

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