Instrumenting Android TV

Assuming that you use Gradle, then instrumenting Android TV application requires only a few easy steps. Before continuing you should have a working Android TV device in your Suitest account.


Instrumenting Android TV application

  1. Download the Suitest instrumentation library for Android TV and copy it into the libs folder.

  2. In your build.gradle file add the following code

    debugCompile 'com.google.code.gson:gson:2.8.0'
    debugCompile(name:'SuitestIL', ext:'aar')
    releaseCompile(name:'SuitestILproduction', ext:'aar')
    
    allprojects {
       repositories {
           jcenter()
           flatDir {
               dirs 'libs'
           }
       }
    }
    
  3. Extend the Application class by adding SuitestInstrumentalApplication.init(this); to the onCreate method. The final result should look like this:

    public class MainApplication extends Application {
    
        @Override
        public void onCreate() {
            super.onCreate();
            SuitestInstrumentalApplication.init(this);
        }
    }
    

debugCompile will include the Suitest IL to debug builds only. releaseCompile will include an empty (without functionality) Suitest IL that only contains the method SuitestInstrumentalApplication.init(this) which is necessary to avoid receiving errors on release builds, it will not alter or effect your release builds. If releaseCompile line is not included then you'll need to remove all Suitest code added from each release build.

Suppressing ProGuard warnings

If you are using ProGuard add the following code to your ProGuard configuration file to suppress the irrelevant warnings:

-dontwarn st.suite.**
-dontnote st.suite.**

Uploading the build to Suitest

After you have instrumented the code create a development build of your application and upload it at the Suitest configuration page. Suitest will automatically install or update the package on the device as necessary when you try running the app on this device.

If you use Suitest Network API you can also send the package with an API request. Suitest will automatically install or update the package on the device as necessary when you try running the app on this device.