SlideShare a Scribd company logo
How to set up Android
Picture-in-picture mode?
(a.k.a Floating window)
+ Best practices
Who am I?
● My name is Mohsen
● I am a hobby Photographer
● I am a YouTuber @AndroidDeveloperTips
● My handle is @mohsenoid
What I do for a living?
● I started software development since 2006
● I started Android Development since 2012
● Which means I know:
○
○ ListView issues before RecyclerView
○ How to survive without Fragment
○ ActionBarSherlock
○ How hard it is to develop with no documentation for the APIs!
● Last year joined Firework, a silicon valley startup (Video Commerce)
How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best practices
What is PiP in Android?
● PiP API introduced since Android N (API level 24)
● PiP Params introduced at Android O (API level 26)
● Auto enter introduce on Android S (API level 31)
● PiP leverages the multi-window APIs
● Appears in the topmost layer, in a corner chosen by the system
● We should ask PackagManager if device support the PiP feature and
it is not disabled because of low RAM
● Activity in PiP mode works as a normal-sized Activity
● There is no direct interaction with UI elements
● We should hide useless UI elements
● To avoid activity recreation we should handle the config changes
● PiP affects the Activity and Fragments lifecycle:
○ After entering PiP mode we get onPause
○ Returning from the PiP mode we get onResume
○ We should handle UX using the isInPictureInPictureMode
● Interactions with the PiP window:
○ Single-tap to display controls and custom actions
○ Double-tap to switch between maximize and minimize
○ Pinch to resize the PiP window
○ Dragging to stash the window to the left/right or down to close
“Talk is cheap,
show me the code!”
– Linus Torvalds
● PiP documentation
○ https://developer.android.com/develop/ui/views/picture-in-picture
● YouTube video
○ https://www.youtube.com/watch?v=bvCKd_XctNg
● Sample repo
○ https://github.com/AndroidDeveloperTips/Player

More Related Content

PDF
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
PDF
Facebook F8 2016
PDF
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
PDF
JDay Sevilla 2015 - Mobile app development for Joomla
PDF
PDF
FXOS Window management 101
PDF
Nicole, Mobile UX
PDF
Mixing Plone and Django for explosive results
Mobile Controls for IBM Lotus Domino XPages on OpenNTF 09/10
Facebook F8 2016
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
JDay Sevilla 2015 - Mobile app development for Joomla
FXOS Window management 101
Nicole, Mobile UX
Mixing Plone and Django for explosive results

Similar to How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best practices (20)

PDF
Betty Blocks On Stage 2018: The Roadmap
PDF
Grilo: Enhancing the multimedia experience in MeeGo (MeeGo Conference San Fra...
PPTX
Introduction To Android Development.pptx
PDF
Nearsoft Mobile Onboarding Workshop
PDF
Android Modularization
PPTX
What’s new in android o
PDF
Android Design
PDF
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
PDF
Dan Crow - Becoming a Data Driven Company LEANCONF 2013
PDF
Presen4 1
ODP
MobileCity: UI UX Design
PDF
Tools to Save Time
PPTX
Introduction to React Native
PDF
Introduce Android TV and new features from Google I/O 2016
PPTX
Flutter not yet another mobile cross-platform framework - i ox-kl19
PDF
Bdd agile requirements
PDF
Top Drupal 8 modules: A tour through the best of Drupal in 2018 [Drupalcon Na...
PDF
From Idea to App in 30 Minutes
ODP
Evaluation - Technology
PDF
Android jumpstart at ESC Boston 2011
Betty Blocks On Stage 2018: The Roadmap
Grilo: Enhancing the multimedia experience in MeeGo (MeeGo Conference San Fra...
Introduction To Android Development.pptx
Nearsoft Mobile Onboarding Workshop
Android Modularization
What’s new in android o
Android Design
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Dan Crow - Becoming a Data Driven Company LEANCONF 2013
Presen4 1
MobileCity: UI UX Design
Tools to Save Time
Introduction to React Native
Introduce Android TV and new features from Google I/O 2016
Flutter not yet another mobile cross-platform framework - i ox-kl19
Bdd agile requirements
Top Drupal 8 modules: A tour through the best of Drupal in 2018 [Drupalcon Na...
From Idea to App in 30 Minutes
Evaluation - Technology
Android jumpstart at ESC Boston 2011
Ad

More from Mohsen Mirhoseini (8)

PDF
Functional Programming in Kotlin for Android Developers
PDF
Top 10 Exception Handling best practices in Kotlin
PDF
Rise from the Ashes: A Developer’s Phoenix Story
PDF
Using protobuf in your android app
PPT
Introduction to Unity3D Game Engine
PPTX
Tehran's 2nd Android bootcamp
PPTX
Tehran's 1st Android bootcamp - Part2
PPTX
Tehran's 1st Android bootcamp - Part1
Functional Programming in Kotlin for Android Developers
Top 10 Exception Handling best practices in Kotlin
Rise from the Ashes: A Developer’s Phoenix Story
Using protobuf in your android app
Introduction to Unity3D Game Engine
Tehran's 2nd Android bootcamp
Tehran's 1st Android bootcamp - Part2
Tehran's 1st Android bootcamp - Part1
Ad

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
assetexplorer- product-overview - presentation
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Download FL Studio Crack Latest version 2025 ?
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
history of c programming in notes for students .pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Patient Appointment Booking in Odoo with online payment
Adobe Illustrator 28.6 Crack My Vision of Vector Design
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
assetexplorer- product-overview - presentation
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Wondershare Filmora 15 Crack With Activation Key [2025
Design an Analysis of Algorithms I-SECS-1021-03
iTop VPN Crack Latest Version Full Key 2025
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Why Generative AI is the Future of Content, Code & Creativity?
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Monitoring Stack: Grafana, Loki & Promtail
Download FL Studio Crack Latest version 2025 ?
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Operating system designcfffgfgggggggvggggggggg
history of c programming in notes for students .pptx
Reimagine Home Health with the Power of Agentic AI​
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Patient Appointment Booking in Odoo with online payment

How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best practices

  • 1. How to set up Android Picture-in-picture mode? (a.k.a Floating window) + Best practices
  • 3. ● My name is Mohsen ● I am a hobby Photographer ● I am a YouTuber @AndroidDeveloperTips ● My handle is @mohsenoid
  • 4. What I do for a living?
  • 5. ● I started software development since 2006 ● I started Android Development since 2012 ● Which means I know: ○ ○ ListView issues before RecyclerView ○ How to survive without Fragment ○ ActionBarSherlock ○ How hard it is to develop with no documentation for the APIs! ● Last year joined Firework, a silicon valley startup (Video Commerce)
  • 7. What is PiP in Android?
  • 8. ● PiP API introduced since Android N (API level 24) ● PiP Params introduced at Android O (API level 26) ● Auto enter introduce on Android S (API level 31)
  • 9. ● PiP leverages the multi-window APIs ● Appears in the topmost layer, in a corner chosen by the system ● We should ask PackagManager if device support the PiP feature and it is not disabled because of low RAM
  • 10. ● Activity in PiP mode works as a normal-sized Activity ● There is no direct interaction with UI elements ● We should hide useless UI elements ● To avoid activity recreation we should handle the config changes
  • 11. ● PiP affects the Activity and Fragments lifecycle: ○ After entering PiP mode we get onPause ○ Returning from the PiP mode we get onResume ○ We should handle UX using the isInPictureInPictureMode
  • 12. ● Interactions with the PiP window: ○ Single-tap to display controls and custom actions ○ Double-tap to switch between maximize and minimize ○ Pinch to resize the PiP window ○ Dragging to stash the window to the left/right or down to close
  • 13. “Talk is cheap, show me the code!” – Linus Torvalds
  • 14. ● PiP documentation ○ https://developer.android.com/develop/ui/views/picture-in-picture ● YouTube video ○ https://www.youtube.com/watch?v=bvCKd_XctNg ● Sample repo ○ https://github.com/AndroidDeveloperTips/Player