Testing YouTube Android Player API on Android phone & Android TV

youtube-android-player-api

  I tested YouTube Android Player API on Android TV devices. Sadly it is not working well with Android TV’s YouTube app (“YouTube for Android TV”). Only YouTube App Launcher Intents works well for now (2016.1.14). YouTube Android Player API YouTube Android Player API is an official library on Google Developers web site, which enables us to integrate YouTube functionality into our (third party’s) Android apps. We can control YouTube video/playlist playback from our app, and customize playback view using YouTube Android Player API. YouTube app must be installed on user’s device As written in the official page, How it works The API client library interacts with a service that is distributed […]

Continue reading →

VerticalGridFragment
– Android TV application hands on tutorial 19

verticalgridfragment

Showing icons on vertical alignment We learned BrowseFragment to show icons, where icons are aligned horizontally when the size increases. VerticalGridFragment is another Fragment provided by leanback support library, where it shows the icons with vertical alignment.   For example, I guess Sideload Launcher – Android TV is using this VerticalGridFragment to show installed app icons.  This post explains how to implement VerticalGridFragment. The implementation is referenced from Google’s sample implementation in the same way as before. Create parent Activity – VerticalGridActivity Starting by creating Activity. right click on “ui” package, [New] → [Activity] → [Blank Activity], type Activity Name as “VerticalGridActivity” and click [Finish]. It will automatically create VerticalGridActivity class, activity_vertical_grid.xml layout resource and add this […]

Continue reading →

BrowseFragment ListRow customization
– Android TV application hands on tutorial 18

CustomListRow

More customization of BrowseFragment – Multiple rows icon alignment on ListRow Continuing from the previous chapter, BrowseFragment Header customization, I proceed to customizing ListRow. Chapter 17: Customizing Header Chapter 18: Customizing ListRow (we are here!) Leanback Launcher app shows multiple rows in Apps, Games bar if the number of icon is many (2 rows are used for “Apps” category in above picture). But original ListRow provided by Leanback support library only allows to show contents in one line. In this chapter, goal is to allow ListRow to show multiple rows in each header, by making customized class of ListRow (Model) and ListRowPresenter (Presenter). Explanation: Dig in source code  ListRow (Model), ListRowView (View), ListRowPresenter (Presenter) is used for […]

Continue reading →