Android Widget

Basic Integration

Make the following changes to your Projects build.gradle

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

add the following dependencies

dependencies { 
    implementation "tv.nexx.android:widget:2.+"
}

Configure the Widget by adding the following Settings to your values/strings.xml:

<resources>
    <string name="widget_domain" translatable="false">YOUR_DOMAIN_ID</string>
    <string name="widget_feed_hash" translatable="false">YOUR_FEED_HASH</string>
    <string name="widget_launchactivity" translatable="false">YOUR_LAUNCH_ACTIVITY</string>
    
    <!-- only needed, if the Feed is secured with a Secret -->
    <string name="widget_feed_secret" translatable="false">YOUR_FEED_SECRET</string>
    <!-- this Parameter can be obtained from 3Q nexx or nexxOMNIA -->
    <string name="widget_app" translatable="false">YOUR_APP_ID</string>
    <!-- only needed for android 12+ -->
    <string name="widget_description">Widget Description</string>
</resources>

Handle the System Intents by adding a receiver to src/main/AndroidManifest.xml:

Prepare the necessary Image Assets (Icon and Preview PNGs) and place them under src/main/res/drawable/

Asset

Dimensions

Usage

widget_icon.png

512x512px

Icon to be shown on the Widget as App Reference

widget_preview.png

660x400px

Icon for Widget Selection Dialogue in android

Handling Intent

Once a User clicks on any Item of the Widget, the App is called directly (if the receiver has been configured correctly).

The App now is responsable to collect all necessary details in order to navigate to the Target of this Intent:

The available Item Identifiers are:

  • itemID

  • itemHash

  • globalID

  • refnr

  • slug

  • link (if configured in nexxOMNIA)

  • domainID

  • streamtype

Enhanced Methods

It is possible to update/refresh/reconfigure all Widget Instances from your App directly with the following Methods:

For a detailed Overview of the Meaning of the given Configuration, please take a look here:

Widget Override Options

Last updated