# Android TV Channel

## Basic Integration

&#x20;Make the following changes to your Projects `build.gradle`

```
...
allprojects{
    repositories{
        maven { url "https://www.myget.org/F/3qnexx/maven" }
    }
}
...
```

&#x20;add the following dependencies

```
dependencies { 
    implementation "tv.nexx.android:tvrecommendations:1.0.03"
}
```

Configure the TV Channel Row by adding the following Settings to your `values/strings.xml:`

```markup
<resources>
    <string name="recommendations_channel_name">Initial Channel Name</string>
    <string name="recommendations_domain" translatable="false">YOUR_DOMAIN_ID</string>
    <string name="recommendations_feed_hash" translatable="false">YOUR_FEED_HASH</string>
    <string name="recommendations_linkintent_uri" translatable="false">YOUR_REGISTERED_APP_INTENT_URI</string>
    
    <!-- only needed, if the Feed is secured with a Secret -->
    <string name="recommendations_feed_secret" translatable="false">YOUR_FEED_SECRET</string>
    <!-- this Parameter can be obtained from 3Q nexx or nexxOMNIA -->
    <string name="recommendations_app" translatable="false">YOUR_APP_ID</string>
</resources>
```

Prepare the necessary Image Asset (Channel Logo JPG) and place them under `src/main/res/drawable/`

| Asset                         | Dimensions | Usage                                      |
| ----------------------------- | ---------- | ------------------------------------------ |
| **recommendations\_icon.jpg** | 80x80px    | Icon to be shown near the Channel Contents |

## Handling Intent

Once a User clicks on any Item of the Channel Row, your App is automatically opened with the corresponding Media. This will only work, if the "recommendations\_linkintent\_uri" String is configured correctly. Futhermore, nexxOMNIA must have the same URI in the Feed Configuration and a valid Template for constructing the Media IDs, that your App can understand.

## Enhanced Methods

It is possible to update/refresh/reconfigure the Recommendation Row from your App directly with the following Methods:

```java
import tv.nexx.android.recommendations.RecommendationManager;
import tv.nexx.android.recommendations.RecommendationConfiguration;

public class MainActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ...
        
        RecommendationManager manager= new RecommendationManager(this.getContext());
        
        //update the Configuration and refresh the Feed
        RecommendationConfigurationconfig=new RecommendationConfiguration(
            new HashMap<String, Object>() {{
               put("language","es");
               put("feedUpdateInterval", 30);
            }}
        );
        manager.updateConfiguration(config);
        
        //updating only the Channel without any new Configuration
        manager.updateChannel();
        
        //enabling background Sync and automatic Updates
        manager.enableAutoUpdate();
    }
}
```

The Recommendation will normally automatically be created and updated by a System Intent on Installation. Nevertheless, updating it manually with these Methods wont disturb the (possibly) existing initial Settings.

## WatchNext

WatchNext is an automatic Row on androidTV, that automatically syncs the Users View Progress and displays them on the StartPage. This is handled by nexxPLAY alone, the Recommendation SDK is not needed for this.

Both Systems though need a valid App Intent URI and a Logic, on how nexxOMNIA/nexxPLAY can construct the Apps Media Reference. Contact 3Q nexx, if the Details are unclear.

{% content-ref url="/pages/-M9Ye9Mxc1uksG\_XiGUp" %}
[nexxPLAY for Android](/native-players/nexxplay-for-android.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://play.docs.nexx.cloud/widgets/widgets-for-native-apps/android-tv-channel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
