android-tv

Android Tv: get list of channels

青春壹個敷衍的年華 提交于 2019-12-01 04:14:33
I've installed the androidtv-sample-inputs so I can fake some Tv inputs and have some channels and I wanted to get information about that channels, however, when I query to get that information I get an empty cursors. What i've tried so far is: TvInputManager tv = (TvInputManager)getApplicationContext().getSystemService(Context.TV_INPUT_SERVICE); List<TvInputInfo> list = tv.getTvInputList(); String[] projection = { TvContract.Channels._ID, TvContract.Channels.COLUMN_DISPLAY_NUMBER }; ContentResolver cr = getContentResolver(); Iterator<TvInputInfo> it = list.iterator(); while(it.hasNext()) {

Android TV App - unable to select list item with remote

我与影子孤独终老i 提交于 2019-12-01 03:34:24
问题 Currently I am working on Android TV app. I have used Android Lean back support library. I have added one ListView , but I can not able to select any of the item from listView with real device's remote. However, I can able to select item of listView on my Android Virtual Device with the help of mouse. Here is my sample code of listView: customViewOrders = new CustomViewOrders(getActivity().getBaseContext(), arrayViewOrders); lstViewOrder.setAdapter(customViewOrders); Here, arrayViewOrders is

Android Tv: get list of channels

前提是你 提交于 2019-12-01 01:44:57
问题 I've installed the androidtv-sample-inputs so I can fake some Tv inputs and have some channels and I wanted to get information about that channels, however, when I query to get that information I get an empty cursors. What i've tried so far is: TvInputManager tv = (TvInputManager)getApplicationContext().getSystemService(Context.TV_INPUT_SERVICE); List<TvInputInfo> list = tv.getTvInputList(); String[] projection = { TvContract.Channels._ID, TvContract.Channels.COLUMN_DISPLAY_NUMBER };

Is it possible to make Android TV app work on Amazon Fire TV?

安稳与你 提交于 2019-11-30 07:28:42
问题 Since the Android TV leanback library is apparently compatible with SDK level 17, which is what the Amazon Fire TV uses, I set the minimum SDK level on my Android TV app and installed it using ADB on my Fire TV. It actually works without any problems. However, it doesn't appear in the apps list in Settings, so I can only launch it through ADB. And when I tried to do a Live App Test in the Amazon Developer console, it won't even install. Are there some settings or something I can change to

Android Gradle Manifest merger failed

好久不见. 提交于 2019-11-29 14:47:51
I use the leanback library to develop for Android TV. My app declare the min API to 16 however the leanback as a minimum API of 16. So as the documentation says I declared this in my manifest : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.mypackage.package"> <uses-sdk tools:overrideLibrary="android.support.v17.leanback" /> However I still have the error : Error:(6, 5) Execution failed for task ':app:processAdhocProdManifest'. Manifest merger failed : uses-sdk:minSdkVersion

android tv -Reloading adapter data

僤鯓⒐⒋嵵緔 提交于 2019-11-29 10:39:58
I want to re-load some of the rows data in a browse fragment. Basically I want to reset the adapter data without causing a flash like effect in the browse fragment. Any idea how it can be done? Something like notifyDataSetChanged() in list view. Thanx This will refresh data without losing current position: for (int i = 0; i < mAdapter.size(); i++) { ListRow listRow = ((ListRow) mAdapter.get(i)); ArrayObjectAdapter listRowAdapter = ((ArrayObjectAdapter) listRow.getAdapter()); if (listRowAdapter.size() > 0) { listRowAdapter.notifyArrayItemRangeChanged(0, listRowAdapter.size()); } } You can

Which resource qualifier should I use to support 1080p, 720p android TV? - Android

一笑奈何 提交于 2019-11-28 10:11:55
In order to define different dimension values for 1080p and 720p android TV, I need to decide which qualifier I should use. When I'm trying to use something like values-sw1080p,values-sw720p, it doesn't work. The values in dimes.xml doesn't affect anything. But it works if I'm using qualifier like -sw540dp,-sw360dp. I don't really understand why like that. Any idea? Thanks. First of all, you are substantially correct. You can use sw360dp/ : 720p screens sw540dp/ : 1080p screens The reason why sw720p/sw1080p don't work is because they don't exist as qualifiers. This is the official

How to increase the size of a current focused item on a RecyclerView? [closed]

两盒软妹~` 提交于 2019-11-28 03:59:59
I'm trying to make an horizontal list with a RecyclerView , that when I put the focus on an item, increase the size of this. I want to make this effect: Do you have any ideas to accomplish this? I'm imagining something like this: Create the horizontal RV When binding the ViewHolder, attach a FocusChangeListener to the root view of the item When the item gains focus, scale it to make it slightly bigger; when the focus is lost, revert the animation. static class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View root) { // bind views // ... // bind focus listener root

android tv -Reloading adapter data

白昼怎懂夜的黑 提交于 2019-11-28 03:50:19
问题 I want to re-load some of the rows data in a browse fragment. Basically I want to reset the adapter data without causing a flash like effect in the browse fragment. Any idea how it can be done? Something like notifyDataSetChanged() in list view. Thanx 回答1: This will refresh data without losing current position: for (int i = 0; i < mAdapter.size(); i++) { ListRow listRow = ((ListRow) mAdapter.get(i)); ArrayObjectAdapter listRowAdapter = ((ArrayObjectAdapter) listRow.getAdapter()); if

android-tv Changing text color and font of browse fragment rows header

萝らか妹 提交于 2019-11-27 06:07:35
问题 How to change text color and font of rows header in browse fragment?. The text not in menu but the text that appears above the rows. 回答1: I am assuming you are using the provided android.support.v17.leanback.widget.RowHeaderPresenter as the presenter for the HeaderFragment in your BrowseFragment . The RowHeaderPresenter inflates the layout from R.layout.lb_row_header which looks like this: <android.support.v17.leanback.widget.RowHeaderView xmlns:android="http://schemas.android.com/apk/res