Skip to main content
Skip table of contents

Creating the project

Use the following procedure to create a new Android Studio project to build the basic player for app development:

  1. Create a suitable directory in Windows Explorer and extract the SDK zip file to it. Rename the opy-sdk-android-4.24.x-integration.jar file nmpsdk.jar.

    The production.jar file is used to build the production version.
  2. In Android Studio, create a new Basic Activity project. In the wizard, set the Minimum API level to 21 (Android 5.0 Lollipop) or higher.

    The Minimum API level refers to the API level needed to build the app. For submission to Google Play Store, this needs to be 28 as new apps must be built to run on Android 9 as a minimum.

  3. In the new project, ensure the  Android  view is selected, select  app  >  manifests, and open the  AndroidManifest.xml  file. Add the following permission before the  <application>   tag.

    CODE
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE" android:maxSdkVersion="22"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  4. Switch to Project view, expand the project and select app. Copy the following .JAR files from the unzipped OpenTV Player SDK folder into the \common\libs   directory.

    • opy-sdk-android-4.24-cpak-3.11.2.0.jar
    • opy-sdk-android-4.24-cpakjava.securestorageagent-3.11.2.0.jar
    • nmpsdk.jar
  5. Select src and open the build.gradle file to verify the following line is present in the dependencies block.

    GROOVY
    implementation fileTree(dir: 'libs', include: ['*.jar'])

Next step: Add OpenTV components

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.