SlideShare a Scribd company logo
1 of 19
Download to read offline
Secondary Screen
Support Using
DisplayManager
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
Getting To Second: Sending
●

HDMI

●

Mobile High-Definition Link (MHL, SlimPort)

●

Proprietary Cable

●

Miracast/AllShare Cast
–

WifiDirect-based display protocol

–

Available on many modern devices, including most of
the Samsung Galaxy line
Copyright © 2013 CommonsWare, LLC
Getting to Second: Receiving
●

HDMI
–
–

●

Direct
Via MHL adapter

Miracast/AllShare Cast
–

Direct (e.g., most of Samsung Smart TVs)

–

Via HDMI adapter

Copyright © 2013 CommonsWare, LLC
Secondary Display: What Is Shown
●

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
–

At least for devices that shipped with 4.2+
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
Exerting Your Control
●

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
Exerting Your Control
●

CWAC-Presentation and PresentationHelper
–

Lets you know when a secondary display
becomes available or goes away

–

Usage
●

Create instance

●

Supply a Context and a Listener

●

Forward onPause() / onResume()

●

Implement showPreso() /
clearPreso()
Copyright © 2013 CommonsWare, LLC
Trying It Out
●

Testing Options
–

Actual “secondary 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
Low-Level Exertion
●

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
Low-Level Exertion
●

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
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
Secondary Screen Strategies
●

Secondary Screen: Not a Touchscreen
–

●

Whatever shows on secondary 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
Secondary Screen Strategies
●

Must Have Secondary Screen
–

●

Optional, Dedicated UX
–

●

Presentation-specific app
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
Secondary Screen Tactics
●

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
Limitations and Annoyances
●

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 secondary
screens?
Copyright © 2013 CommonsWare, LLC
Limitations and Annoyances
●

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

–

General rule: one activity and one
Presentation, just updating content
Copyright © 2013 CommonsWare, LLC

More Related Content

What's hot

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to heroAhmed Abu Eldahab
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Opersys inc.
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsHansol Lee
 
FEX -PPT By NETWORKERS HOME
FEX -PPT By NETWORKERS HOMEFEX -PPT By NETWORKERS HOME
FEX -PPT By NETWORKERS HOMEnetworkershome
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android StudioSuyash Srijan
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksAlbiorix Technology
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDKdigitaljoni
 
AIDL - Android Interface Definition Language
AIDL  - Android Interface Definition LanguageAIDL  - Android Interface Definition Language
AIDL - Android Interface Definition LanguageArvind Devaraj
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
DDS: The IoT Data Sharing Standard
DDS: The IoT Data Sharing StandardDDS: The IoT Data Sharing Standard
DDS: The IoT Data Sharing StandardAngelo Corsaro
 
android phone ppt
android phone pptandroid phone ppt
android phone pptmehul patel
 

What's hot (20)

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
 
Init of Android
Init of AndroidInit of Android
Init of Android
 
Kotlin Multiplatform
Kotlin MultiplatformKotlin Multiplatform
Kotlin Multiplatform
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjects
 
FEX -PPT By NETWORKERS HOME
FEX -PPT By NETWORKERS HOMEFEX -PPT By NETWORKERS HOME
FEX -PPT By NETWORKERS HOME
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development Frameworks
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
 
AIDL - Android Interface Definition Language
AIDL  - Android Interface Definition LanguageAIDL  - Android Interface Definition Language
AIDL - Android Interface Definition Language
 
Flutter
FlutterFlutter
Flutter
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Firewalld
FirewalldFirewalld
Firewalld
 
DDS: The IoT Data Sharing Standard
DDS: The IoT Data Sharing StandardDDS: The IoT Data Sharing Standard
DDS: The IoT Data Sharing Standard
 
Android ppt
 Android ppt Android ppt
Android ppt
 
android phone ppt
android phone pptandroid phone ppt
android phone ppt
 

Viewers also liked

Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2CommonsWare
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on androidLi SUN
 
Iniciando no desenvolvimento android 2016
Iniciando no desenvolvimento android 2016Iniciando no desenvolvimento android 2016
Iniciando no desenvolvimento android 2016Jose Naves Moura Neto
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in androidAngelo Rüggeberg
 
Design Multiple Screen android
Design Multiple Screen androidDesign Multiple Screen android
Design Multiple Screen androidChaiwoot Phrombutr
 
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 Projecthidenorly
 
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)DroidConTLV
 
Screen orientations in android
Screen orientations in androidScreen orientations in android
Screen orientations in androidmanjakannar
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia FrameworkOpersys inc.
 
Practical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacksPractical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacksSecurity Session
 
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 imagesChris Simmonds
 

Viewers also liked (20)

Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
Iniciando no desenvolvimento android 2016
Iniciando no desenvolvimento android 2016Iniciando no desenvolvimento android 2016
Iniciando no desenvolvimento android 2016
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in android
 
Design Multiple Screen android
Design Multiple Screen androidDesign Multiple Screen android
Design Multiple Screen android
 
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
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
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 Secondary Screen Support Using DisplayManager

Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APISamsung Open Source Group
 
Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APISamsung Open Source Group
 
Google TV For Fun
Google TV For FunGoogle TV For Fun
Google TV For FunCommonsWare
 
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 ViewCommonsWare
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screenHeinrich Seeger
 
The future of WebRTC - Sept 2021
The future of WebRTC - Sept 2021The future of WebRTC - Sept 2021
The future of WebRTC - Sept 2021Arnaud BUDKIEWICZ
 
Android Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинAndroid Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинGDG Saint Petersburg
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment a8us
 
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0Amir Zmora
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networkingKikima Jimmy
 
Hitting a moving target: achieving mobile inclusion
Hitting a moving target: achieving mobile inclusionHitting a moving target: achieving mobile inclusion
Hitting a moving target: achieving mobile inclusionJon Gibbins
 
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 DevicesMotorola Mobility - MOTODEV
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly BeanCommonsWare
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabalPrabal Tyagi
 
A Guide to the Top Cross Platform Video Players
A Guide to the Top Cross Platform Video PlayersA Guide to the Top Cross Platform Video Players
A Guide to the Top Cross Platform Video PlayersRoshan Dwivedi
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical Jimmin Kurichiyil
 
Mis Presentation Quest
Mis Presentation  QuestMis Presentation  Quest
Mis Presentation QuestDevdut Saha
 
160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault micro160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault microStartupAlliance
 
BP503 IBM Connect 2014
BP503 IBM Connect 2014BP503 IBM Connect 2014
BP503 IBM Connect 2014Peter Lurie
 

Similar to Secondary Screen Support Using DisplayManager (20)

Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller API
 
Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller API
 
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
 
Mobile apps on the big screen
Mobile apps on the big screenMobile apps on the big screen
Mobile apps on the big screen
 
The future of WebRTC - Sept 2021
The future of WebRTC - Sept 2021The future of WebRTC - Sept 2021
The future of WebRTC - Sept 2021
 
Android Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинAndroid Meetup, Илья Лёвин
Android Meetup, Илья Лёвин
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment
 
CDS Cloud Network Media Player
CDS Cloud Network Media Player CDS Cloud Network Media Player
CDS Cloud Network Media Player
 
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
WebRTC Standards & Implementation Q&A - getDisplayMedia 1.0
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networking
 
Hitting a moving target: achieving mobile inclusion
Hitting a moving target: achieving mobile inclusionHitting a moving target: achieving mobile inclusion
Hitting a moving target: achieving mobile inclusion
 
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
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly Bean
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabal
 
A Guide to the Top Cross Platform Video Players
A Guide to the Top Cross Platform Video PlayersA Guide to the Top Cross Platform Video Players
A Guide to the Top Cross Platform Video Players
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical
 
Mis Presentation Quest
Mis Presentation  QuestMis Presentation  Quest
Mis Presentation Quest
 
160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault micro160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault micro
 
BP503 IBM Connect 2014
BP503 IBM Connect 2014BP503 IBM Connect 2014
BP503 IBM Connect 2014
 

More from CommonsWare

Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsCommonsWare
 
Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your WearablesCommonsWare
 
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 AppsCommonsWare
 
The Action Bar: Front to Back
The Action Bar: Front to BackThe Action Bar: Front to Back
The Action Bar: Front to BackCommonsWare
 
Android Security: Defending Your Users
Android Security: Defending Your UsersAndroid Security: Defending Your Users
Android Security: Defending Your UsersCommonsWare
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail PatternCommonsWare
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful ThreadingCommonsWare
 
Maps V2... And You!
Maps V2... And You!Maps V2... And You!
Maps V2... And You!CommonsWare
 
A Deep Dive Into ViewPager
A Deep Dive Into ViewPagerA Deep Dive Into ViewPager
A Deep Dive Into ViewPagerCommonsWare
 
Integrate Android Apps and Web Apps
Integrate Android Apps and Web AppsIntegrate Android Apps and Web Apps
Integrate Android Apps and Web AppsCommonsWare
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile WebCommonsWare
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of WearablesCommonsWare
 
Securing User Data with SQLCipher
Securing User Data with SQLCipherSecuring User Data with SQLCipher
Securing User Data with SQLCipherCommonsWare
 
Beaming Data to Devices with NFC
Beaming Data to Devices with NFCBeaming Data to Devices with NFC
Beaming Data to Devices with NFCCommonsWare
 
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 ModelsCommonsWare
 
AppsWorld Keynote
AppsWorld KeynoteAppsWorld Keynote
AppsWorld KeynoteCommonsWare
 
App Integration (Revised and Updated)
App Integration (Revised and Updated)App Integration (Revised and Updated)
App Integration (Revised and Updated)CommonsWare
 
Rich Text Editing and Beyond
Rich Text Editing and BeyondRich Text Editing and Beyond
Rich Text Editing and BeyondCommonsWare
 
App integration: Strategies and Tactics
App integration: Strategies and TacticsApp integration: Strategies and Tactics
App integration: Strategies and TacticsCommonsWare
 

More from CommonsWare (20)

Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
 
Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
 
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
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail Pattern
 
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
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile Web
 
X Means Y
X Means YX Means Y
X Means Y
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of Wearables
 
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
 
App Integration (Revised and Updated)
App Integration (Revised and Updated)App Integration (Revised and Updated)
App Integration (Revised and Updated)
 
Rich Text Editing and Beyond
Rich Text Editing and BeyondRich Text Editing and Beyond
Rich Text Editing and Beyond
 
App integration: Strategies and Tactics
App integration: Strategies and TacticsApp integration: Strategies and Tactics
App integration: Strategies and Tactics
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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 RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Secondary Screen Support Using DisplayManager

  • 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. Getting To Second: Sending ● HDMI ● Mobile High-Definition Link (MHL, SlimPort) ● Proprietary Cable ● Miracast/AllShare Cast – WifiDirect-based display protocol – Available on many modern devices, including most of the Samsung Galaxy line Copyright © 2013 CommonsWare, LLC
  • 4. Getting to Second: Receiving ● HDMI – – ● Direct Via MHL adapter Miracast/AllShare Cast – Direct (e.g., most of Samsung Smart TVs) – Via HDMI adapter Copyright © 2013 CommonsWare, LLC
  • 5. Secondary Display: What Is Shown ● 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 – At least for devices that shipped with 4.2+ Copyright © 2013 CommonsWare, LLC
  • 6. 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
  • 7. Exerting Your Control ● 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
  • 8. Exerting Your Control ● CWAC-Presentation and PresentationHelper – Lets you know when a secondary display becomes available or goes away – Usage ● Create instance ● Supply a Context and a Listener ● Forward onPause() / onResume() ● Implement showPreso() / clearPreso() Copyright © 2013 CommonsWare, LLC
  • 9. Trying It Out ● Testing Options – Actual “secondary 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. Low-Level Exertion ● 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
  • 13. Low-Level Exertion ● 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
  • 14. 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
  • 15. Secondary Screen Strategies ● Secondary Screen: Not a Touchscreen – ● Whatever shows on secondary 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. Secondary Screen Strategies ● Must Have Secondary Screen – ● Optional, Dedicated UX – ● Presentation-specific app 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
  • 17. Secondary Screen Tactics ● 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
  • 18. Limitations and Annoyances ● 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 secondary screens? Copyright © 2013 CommonsWare, LLC
  • 19. Limitations and Annoyances ● 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 – General rule: one activity and one Presentation, just updating content Copyright © 2013 CommonsWare, LLC