Android Support Library 25.1 – Improved Navigation and Media Playback

December’s update to the Android support library includes better focusing when using DPADs in RecyclerViews and adds a leanback.media package with helper classes for Android TV media players.

The support library has quickly become an important tool for developers. It adds in a variety of APIs that can be used on many API levels without requiring an update to the underlying operating system. Therefore, users can get a lot of features in apps without needing the latest OS version. Developers can import it with a single line in their gradle file and quickly get started with these tools.

In the latest update, version 25.1.0, there are a number of changes. Some of them are general, like specifying the number of items to fetch in a RecyclerView. There are also changes that may be more specific to Android TV, and those are the ones we’ll focus on.

Added focus recovery mechanism to RecyclerView. This also fixed support pref fragments broken focus when using DPAD navigation such as on Android TV devices.

The RecyclerView is a simple, cross-platform presenter which allows developers to display an indefinite amount of content in a scrolling view. With this recent change, focusing is now improved. This should make it easier to place these into apps and have the same layout work on a phone or TV.

The new package android.support.v17.leanback.media contains a number of useful classes for building media player UI. The PlaybackControlGlue and PlaybackGlueHost allow developers to build activities that play media and show playback controls so users can have greater control over how they watch the content.

There is also a new package for processing images. The ExifSupportLibrary can read JPEG or RAW image formats and parse metadata. Exif data can be optionally added to these photos to provide greater context. It may include the photo’s geolocation, the camera and aperture used, or other things.

With this library, all of the specific nuances between these formats, and the subformats, are handled automatically. It’s now easy to read the metadata and use it in an app, or set the data to something else.

If you haven’t taken a look at the support library yet, this may be a good opportunity to do it. The APIs are well-tested and update frequently to support most phones. You can learn more on the Android Developers page.

Nick Felker

Nick Felker

Nick Felker is a student Electrical & Computer Engineering student at Rowan University (C/O 2017) and the student IEEE webmaster. When he's not studying, he is a software developer for the web and Android (Felker Tech). He has several open source projects on GitHub (http://github.com/fleker) Devices: Moto G-2013 Moto G-2015, Moto 360, Google ADT-1, Nexus 7-2013 (x2), Lenovo Laptop, Custom Desktop. Although he was an intern at Google, the content of this blog is entirely independent and his own thoughts.

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusReddit