Making AndroidTV app workable on FireTV

我怕爱的太早我们不能终老 提交于 2019-12-21 13:45:29

问题


I have an android tv app using a leanback library that I want to publish to amazon tv store also. I know that we can use leanback library for fire tv as per this link using a standard LAUNCHER. However I am not sure about a few things:

  1. Recommendations

Android TV display content recommendations in the first row of the TV home screen

Content recommendations appear as the first row of the TV home screen after the first use of the device

For this we need to create a recommendation service and build recommendations in the android tv app.

Does FireTV also show recommendations and requires a recommendation service to be present in the firetv app? Quoting from this link

The global navigation menu is the primary system menu. It appears in a row on the left side of the screen. The global navigation menu allows the user to choose major content categories or other options including Search, Home, Movies, TV, Music, Games, Apps, and so on.

Is global navigation menu on the Fire TV similar to content recommendations row on Android TV?

  1. Global Search

Android TV uses the Android search interface to retrieve content data from installed apps and deliver search results to the user. Android TV app implements a Content Provider along with a searchable.xml configuration file for the purpose.

Is global search available on Fire TV and do we need to provide a content provider similar to Android TV app ? Quoting from this link

Global search is provided system-wide and is not customizable for individual apps. Developers may implement their own in-app search, but it is not included in the global search function.

  1. In app Search

The Leanback support library provides a set of classes to enable a standard search interface within your app that is consistent with other search functions on TV and provides features such as voice input.

Since leanback support library can be used with Android API level 17 for Fire TV, I think leanback SearchFragment can be used for FireTV as well. But is voice input to be handled differently?


回答1:


  1. Recommendations

No, Fire TV does not support recommendations, IIRC.

  1. Global search

Same as the previous point.

  1. In app search

Yes, you can use the SearchFragment class. However (not sure about the recent versions of Leanback), there are a few quirks due to how the mic input is handled. One of the things that were to be done is disabling the speech recognizer:

Field mSpeechRecognizerField = SearchFragment.class.getDeclaredField("mSpeechRecognizer");
mSpeechRecognizerField.setAccessible(true);
mSpeechRecognizerField.set(this, null);

You may encounter one or two more.



来源:https://stackoverflow.com/questions/30930871/making-androidtv-app-workable-on-firetv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!