Android N is now available for people to download to their Android phones, tablets, or Android TV.
One huge feature is API support for recording media, which effectively gives Android TV support for a DVR. But what if you want your TV to be slightly more productive? Android N gives phones and tablets multi-window support, but what about on TVs?
Android TV now supports picture-in-picture, which can be enabled per activity through an addition to your manifest.
The tiny PIP window is displayed in one of the four corners of the screen. By holding down the home button, a PiP menu appears that gives the user some control over the window’s control to expand or close it. It’s not known how NVIDIA plans to integrate that. Holding home on the Shield opens up a screen recording menu.
Your app can enter PiP by calling
Which you can interpret through the callback
public void onPictureInPictureChanged(boolean inPictureInPicture)
Your media can play indefinitely until another app starts playing media. That will close the PiP window (although it’s hard to say through what means).
This is of course a major feature that can have a variety of benefits. One example is an improved YouTube app. Like on the phone, the video can be put into a corner of the screen while you search for other videos and continue browsing.
Developers can check out the documentation for adding this feature to their apps in the new Android N preview, although it’s definitely subject to change depending on public feedback over the next few months.