For the last couple of months, my colleague Daniele Bonaldo and I have been working on a new project for MUBI. While Novoda had previously developed the Android phone, tablet, and Amazon Fire applications for the service, this project promised to be an especially exciting new challenge.
MUBI is a video streaming service with a focus only offering high-quality, hand-picked movies which film enthusiasts can enjoy. While other streaming services offering difficult-to-explore catalogues of varying quality, MUBI focuses on providing the user just 30 films and with a new, hand-picked film added daily.
During the course of this project, we’re proud to have developed for the newest platform to be added to that list: Google’s Android TV.
MUBI for Android TV
(Android TV, for anyone who may have missed its launch, is Google’s new smart-TV platform, offering applications designed to be used on a TV and from the comfort of a sofa, all without the need for a phone or tablet.)
After a lot of hard work, we are proud to announce that not only is MUBI is now available on Android TV, but has also has been nominated by Google to be featured on the Android TV platform as well as being pre-installed on all Nexus Player devices sold in the UK!
But how did we get there? Let’s get into the detail.
Exciting new features
Before we began we were already excited about the opportunities the platform presented, and not only because of the varied technical challenges it would offer. We were also looking forward to the opportunity to integrate the service with all the new Android TV features that the platform provides.
Features like OS-level recommendations integrated voice search and beautiful ‘Daydream’ screensavers are just a few examples of integrations that applications on the platform can leverage. That level of integration doesn’t happen without some work, of course, so let’s talk about how we approached each of these features.
A great way to increase the visibility of an app and surface its content to the user is global search. With global integration, an app can be queried by the system and have the results displayed on a global result screen (alongside the results from other apps). For MUBI, this is a perfect way to make sure the user is able to discover all the currently available films without necessarily having to open the app. This not only provides quick access for those who know what they want to watch, but also allows for happy discovery by users who’re just browsing around.
On Android TV the user has two ways to perform a global search:
- Through the search widget on the home screen
- By initiating a voice search using the remote
In both cases, if the query leads to one or more matching films a dedicated row is presented in the search results screen. The user can then directly access the film details and start playing without having to navigate further inside the app.
The Android TV search framework can also create a deep-link to a ‘watch’ action for a specific film from the search results screen. This will happen when a search result matches a specific piece of data for a given film, including title and production year.
Here, the system will sometimes propose different apps providing the same content. This means the user can browse content (in this case, movies) without having to dive into specific applications.
In the case of MUBI, when the user selects “available on MUBI”, the application will start and land the user on the the relevant film details screen, allowing them to immediately play the film if they wish.
Deep-link in the film details result
In order to deliver these unified search results to the user, Android TV retrieves content data from all installed apps using content providers.
An app that wants to provide global search must implement:
- A content provider that will serve suggestions while the user enters characters in the search dialogue, along with the permission
android.permission.GLOBAL_SEARCHin order to allow Android TV to query it.
- A configuration file which describes the content provider and contains informations required by Android TV.
- An Activity that is able to handle the Intent fired when the user selects one of the query results must be specified too.
So it’s actually pretty simple.
It is always difficult to decide what to watch among a myriad of content and services. It is really not user friendly to have to go to every single application, check the content, check if it’s new, navigate through all the sections, and finally then decide that we are going to move to another application because there is nothing interesting to watch.
For that reason, Google offers a recommendations stream directly on the main Android TV home screen. This stream is populated by the operating system after learning what content the user is interested in. This allows the home screen to constantly surface the most relevant content from all of the applications that the user has installed.
Of course, this only happens if those applications are set up to contribute to the recommendations stream. This is something we were keen to implement with MUBI.
The most popular film recommendation card
Working with MUBI we iterated through various approaches to the feature before finally settling on a fairly simple approach: we recommend the most popular film among the 30 films available at any time. If the user has already watched the film, we simply update the recommendation to display the next most popular film.
This all happens under the hood and without the user having to do anything—just enjoy watching movies and MUBI will always be hand to recommend some other great film.
Google Cast integration
Google Cast is a technology that allows Android, iOS apps and Chrome web apps to ‘cast’ video, audio, and screen sharing to Cast-ready devices.
The most popular of these devices is the Chromecast, but Android TV is another Google Cast ready device that we were eager to cater for.
An obvious use-case for such a technology is to allow a user to cast films from a streaming service (such as MUBI) and watch them directly on the big screen of a TV. For this reason we wanted to ensure that we implemented the best possible Cast support for MUBI.
The end-result is that a user can use MUBI from any mobile device (not necessarily Android) to cast their chosen film directly to a Chromecast or an Android TV without necessarily having the app installed in the device itself.
Once the film is being cast, the mobile device becomes a controller for the film’s playback, while the Cast device handles streaming the selected film itself. As the mobile device is not streaming video to the TV or Cast device directly itself, casting a film has no great effect on the mobile device’s battery—far less than streaming the film directly on the phone or tablet would do.
Alongside integration of the Chromecast into the Android applications, we also helped implement the server communication and synchronization in the Chromecast-specific code to allow for seamless pausing and resuming across devices and casting—this provides a unified experience for the MUBI users. The end result is that a user can start casting a MUBI film to watch on their TV, stop watching it, and continue right from where they left off on their mobile device. And this device doesn’t even have to be an Android phone or tablet—the server-side synchronization gives the user the ability to continue watching a movie at the correct position on all devices and platforms supported by MUBI, including from the web or from a Fire TV device.
If you’re interested in more details, this article includes the whole set of cast-related features we introduced in MUBI.
Screensavers have existed for a long time, with the express purpose of protecting monitors from a burn-in effect. From Android 4.2, an equivalent feature, with the name of Daydream, became available on phones and tablets. Given their availability on Android TV, their purpose is now even more relevant.
Daydreams are particularly interesting and fun for an app like MUBI. With its great selection of high-quality film posters, there was obvious choice for what we could showcase as a MUBI daydream. The final Daydream MUBI implementation shows the poster of a current film, displaying the title and director of the film with subtle but beautiful animations. This is changed every few minute to prevent screen-burn, but also serves to highlight MUBI content, as well as just being pleasantly distracting.
Daydream screen saver
A single APK
Android applications are packaged in a file called APK (Android application Package). When you install an application from the Google Play store, this APK file is downloaded and installed into your device.
Many developers create different APK files for different devices or platforms. For example, many create one APK file that runs on phones and another to be used by tablet. This would typically happen if the tablet version differs heavily in format or layout to the phone version or the developer is simply feeling lazy. When a user searches for an application, the listing in the Play Store may look the same, but the APK the user ends up downloading will be different.
This is actually a bad practice. Google recommends creating one APK for all platforms and screen factors. This single application should then adapt itself to be displayed in the right format for phones, tablets, or TV.
There are advantages and disadvantages to creating just one APK. Here the key points:
- If one APK serves all platforms, that APK has to have the resources for every platform. This means that if the device has a low-resolution screen, the APK will still come bundled with high-resolution icons and resources that will never be used. As a result, the size of the APK file created for all devices will be bigger than a APK created for a single device type.
- Sometimes it’s simply is not possible to offer just one APK file due to limitations on third-party stores or the targeting of specific hardware architecture. For example, the Amazon App Store doesn’t allow APKs that contain specific libraries built for the Google Play Store. In this case, the only option is to remove all code that is not allowed from the final APK and create a variant specifically for submission to the Amazon App store.
But there is one major selling point for offering a single APK (at least in the Google ecosystem): when you first log in into a new Android device (such as a new Android TV), Google automatically downloads any applications you may have installed on other Android devices you already own (such as an Android phone).
Working right out of the box
This means that if you have the MUBI installed on your phone and you buy a new tablet, shortly after logging in you’ll find you have it installed. And, as it’s built using a single, adaptive APK, the application will be tablet-ready right out of the box.
This becomes even more important with Android TV, where searching for applications can be a little trickier than with a touch-screen. With the single APK approach, users who’ve installed MUBI on their phones will automatically have the MUBI Android TV version ready to use shortly after turning it on, all without having to visit the Play Store.
The future of the application
There are even more features to come, such as integration with Google Now, seamless background playing on Android TV and, well, you’ll have to see.
It is a really exciting moment to be in the Android system right now and we can’t say how proud we are to worked with MUBI on bringing their fantastic service to another platform. Get downloading and let us know what you think.
(Special thanks to Daniele and everyone who has collaborated in this blogpost.)