Requires a pro subscription Pro

Implementing Picture In Picture Mode In Android

Implement Picture In Picture mode to allow users to watch videos even while they use other apps. See how a real-world app uses PiP, then learn how to add awesome media playback controls to PiP mode for ease of use! By Filip Babić.

Login to leave a rating/review
Save for later
Share

Learning path

This is part of the Android UI & UX: Beyond the Basics learning path. View Path.

Who is this for?

Intermediate and advanced Android developers looking to implement Picture In Picture (PiP) mode to provide cool ways for users to keep using their apps while working on other things with their phone.

You should be familiar with Android Studio and Kotlin. Knowledge about using advanced code structures to build different layers in your apps and communicate between them is welcomed.

This course covers a feature from the raywenderlich.com app! Check out the open-source repo here.

Covered concepts

  • Android Screen Resizing
  • Multi-tasking Android apps
  • Picture-In-Picture mode in Android
  • Picture-In-Picture Parameters
  • Picture-In-Picture Lifecycle
  • Configuration Changes
  • BroadcastReceivers
  • MediaPlayer
  • MediaPlayer Actions

Part 1: Implement Picture In Picture Mode

1
Toggle description

Picture In Picture allows users to control an app while they're doing something else! Learn the basics about PIP mode and how it changes the way users can interact with your apps.

Toggle description

Check out the Emitron app, then set up the sample project with Firebase and build configuration.

Learn how to enable PiP mode for Activities through the Android Manifest, and how to enter the PiP mode & attach it to the Activity lifecycle.

Toggle description

Extend your PiP mode functionality to your Fragment, and learn how to expose it through a BroadcastReceiver.

Toggle description

Build the functions of one of the core classes that will let you handle the PiP mode and communicate its state.

Toggle description

Add actions to the PiP container to display different media controls and prepare their actions.

Toggle description

Learn how to process media control by observing the PipAction value from the BroadcastReceiver, allowing the user to use the PiP mode completely.