Android TV API

TV hardware is substantially different from other Android devices. TVs do not include some of the hardware features found on other Android devices, such as touch-screens, cameras, and GPS receivers. TVs are also completely dependent on secondary hardware devices. In order for users to interact with TV apps, they must use a remote control or game pad. When you build an app for TV, you must carefully consider the hardware limitations and requirements of operating on TV hardware.

This lesson discusses how to check if your app is running on a TV, how to handle unsupported hardware features, and discusses the requirements for handling controllers for TV devices.


Check for a TV Device

If you are building an app that operates both on TV devices and other devices, you may need to check what kind of device your app is running on and adjust the operation of your app. The following example code shows you how to check if your app is running on a TV device:

TVAppController.DeviceTypeChecked += OnDeviceTypeChecked;

void OnDeviceTypeChecked () {
	AN_PoupsProxy.showMessage("Check for a TV Device Result" , TVAppController.instance.IsRuningOnTVDevice.ToString());
	TVAppController.DeviceTypeChecked -= OnDeviceTypeChecked;