Home Android Tutorial Develop basic android TV application

Develop basic android TV application

Develop basic android TV application
Develop basic android TV application

Android TV application development introduction
Currently, we have still not enough introduction for Android TV application development yet. In this series of tutorials, I will introduce how to develop an Android TV application.
This post aims to understand Android “TV” specific code implementation, especially focusing on UI implementation.

Because UI is one of the biggest differences between Android phone apps and Android TV apps. We need to make UI suitable for TV usage, for example, we should make an app so that we can navigate the application only using ↑↓→← direction keys, instead of touchpad navigation. Because user uses remote controller, and cannot use “touch screen” function with TV. To achieve this requirement, the Android open-source project is providing a Leanback Support library (android.support.v17.leanback) so that developers can easily implement UI which satisfies these requirements and is thus suitable for TV usage. This tutorial mainly explains the usage of this Leanback library.

The target of this post is people who,

developed Android apps before, but are not familiar with Android TV apps.
beginner-intermediate level
Since Eclipse support will be finished at the end of 2015, Android studio will be used for the IDE to develop Android TV apps (So please download and set up Android Studio, if you have not yet done!). Note that most of the code introduced here is from the AOSP android TV sample source code. This tutorial is just a detailed explanation of this sample source code. Let’s begin.

Do you remember the pre-smartphone era? We expect you don’t need a time machine to remember what mobility was like in 2006. Back then, Windows, Symbian, and Blackberry had been slowly supplying the mobile market with so-called pocket personal computers – clunky, unattractive, enabled with a physical QWERTY keyboard and sometimes even a stylus. You might have had one of those. Early smartphones focused strictly on productivity. Consequently, there was one problem that plagued the minds of hardware and software providers: how to fit more into one tiny device?

They were doing quite well. We had Twitter and email, Internet browser, Microsoft Word, and many more handy features, but websites were not responsive, mobile Internet was slow, and people still used to sit down at their full-size PCs for a task that took longer than five minutes. The usability wasn’t considered at all – together with developers’ freedom. This was a restrictive world to operate in.