Tuesday, September 13, 2016

Android TV App Building Concept

Building TV Apps

Android offers a rich user experience that's optimized for apps running on large screen devices, such as high-definition televisions. Apps on TV offer new opportunities to delight your users from the comfort of their couch.


  • TV apps use the same structure as those for phones and tablets.
  • This approach means you can create new TV apps based on what you already know about building apps for Android, or extend your existing apps to also run on TV devices. 
  • However, the user interaction model for TV is substantially different from phone and tablet devices. In order to make your app successful on TV devices, you must design new layouts that can be easily understood from 10 feet away, and provide navigation that works with just a directional pad and a select button.

There are few points you can note while TV app development such as
  1. Handling TV Hardware
  2. Building TV Layouts
  3. Creating TV Navigation
Each of them plays a very vital role in Android Tv app development.Lets see how they
impact on the development but before that you must have understanding about few things
such as

1)Supported Media Formats
2)DRM
3)android.drm
4)ExoPlayer
5)android.media.MediaPlayer

And Android TV app uses lean back support.

1)Declare Leanback support for TV:

Declare that your app uses the Leanback user interface required by Android TV. If you are developing an app that runs on mobile (phones, wearables, tablets, etc.) as well as Android TV, set the required attribute value to false. If you set the required attribute value to true, your app will run only on devices that use the Leanback UI.

<manifest>
    <uses-feature android:name="android.software.leanback"
        android:required="false" />
</manifest>

So there are few things also which are not required at TV app development.

2)Declare touchscreen not required:

Applications that are intended to run on TV devices do not rely on touch screens for input. In order to make this clear, the manifest of your TV app must declare that a the android.hardware.touchscreen feature is not required. This setting identifies your app as being able to work on a TV device, and is required for your app to be considered a TV app in Google Play. The following code example shows how to include this manifest declaration:

<manifest>
    <uses-feature android:name="android.hardware.touchscreen"
              android:required="false" />
</manifest>

3)Provide a home screen banner:

An application must provide a home screen banner image for each localization if it includes a Leanback launcher intent filter. The banner is the app launch point that appears on the home screen in the apps and games rows. When designing your banner, follow the design requirements described in Banners. To add the banner to your app, describe the banner in the manifest as follows:

<application
    android:banner="@drawable/banner" >
</application>

4)Add TV Support Libraries:

The Android SDK includes support libraries that are intended for use with TV apps. These libraries provide APIs and user interface widgets for use on TV devices. The libraries are located in the <sdk>/extras/android/support/ directory. Here is a list of the libraries and their general purpose:

a)v17 leanback library - Provides user interface widgets for TV apps, particularly for apps that do media playback.

b)v7 recyclerview library - Provides classes for managing display of long lists in a memory efficient manner. Several classes in the v17 leanback library depend on the classes in this library.

c)v7 cardview library - Provides user interface widgets for displaying information cards, such as media item pictures and descriptions.
Note: You are not required to use these support libraries for your TV app. However, we strongly recommend using them, particularly for apps that provide a media catalog browsing interface.

If you decide to use the v17 leanback library for your app, you should note that it is dependent on the v4 support library. This means that apps that use the leanback support library should include all of these support libraries:

v4 support library
v7 recyclerview support library
v17 leanback support library
The v17 leanback library contains resources, which require you to take specific steps to include it in app projects. For instructions on importing a support library with resources, see Support Library Setup.


5)Declaring hardware requirements for TV:

<uses-feature android:name="android.hardware.touchscreen"
        android:required="false"/>
<uses-feature android:name="android.hardware.faketouch"
        android:required="false"/>
<uses-feature android:name="android.hardware.telephony"
        android:required="false"/>
<uses-feature android:name="android.hardware.camera"
        android:required="false"/>
<uses-feature android:name="android.hardware.nfc"
        android:required="false"/>
<uses-feature android:name="android.hardware.location.gps"
        android:required="false"/>
<uses-feature android:name="android.hardware.microphone"
        android:required="false"/>
<uses-feature android:name="android.hardware.sensor"
        android:required="false"/>

Android apps can declare hardware feature requirements in the app manifest to ensure that they do not get installed on devices that do not provide those features. If you are extending an existing app for use on TV, closely review your app's manifest for any hardware requirement declarations that might prevent it from being installed on a TV device.

If your app uses hardware features (such as a touchscreen or camera) that are not available on TV, but can operate without the use of those features, modify your app's manifest to indicate that these features are not required by your app. The following manifest code snippet demonstrates how to declare that your app does not require hardware features which are unavailable on TV devices.

So, These are few things which are basic requirement for Android TV App Development and must
be taken care while Android TV app Development. Now,So if we can not use touch screen and so how we will navigate within the Application.Will tell you in next tutorial.



No comments: