Skip to main content

Android Installation

Please follow this guide to integrate the Android SDK in your React Native Application.

Android SDK Setup​

In order to use LuraPlayer with android, it is necessary to copy the provided android release builds in the MCP > Play Services > Player SDK's into the <project_root>/android/app/libs/ folder. Besides our android sdk, you need to put the third party sdks you want to use to the libs folder.

Here are some example libraries

  • AnvatoAndroidSDK.aar
  • adobeMobileLibrary.jar
  • android_accessenabler.jar
  • libAndroidMediaAnalytics.jar
  • NBZ-moat-mobile-app-kit.aar
  • play-services-pal.aar
  • VideoHeartbeat.jar

<project_root>android/app/build.gradle​

From version >= 5.0.0, you have to apply these changes:

dependencies {
//
+ implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
+ implementation 'androidx.multidex:multidex:2.0.1'
+ implementation 'com.google.code.gson:gson:2.8.6'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'androidx.mediarouter:mediarouter:1.1.0'
+ implementation 'com.comscore:android-analytics:6.3.1'
+ implementation "com.google.guava:guava:29.0-android"
+ implementation 'com.google.android.gms:play-services-ads:19.3.0'
+ implementation 'com.google.android.gms:play-services-analytics:17.0.0'
+ implementation 'com.google.android.gms:play-services-cast-framework:19.0.0'
+ implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
+ implementation 'com.google.android.exoplayer:extension-ima:2.18.1'
+ implementation 'com.squareup.picasso:picasso:2.71828'
+ implementation 'com.android.support:design:24.+'
- implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
...
}

In your apps MainApplication.java​

@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
...
+ packages.add(new com.lura.rn.LuraVideoPackage());
...
return packages;
}

<project_root>android/gradle.properties​

Migrating to AndroidX (needs version >= 5.0.0):

android.useAndroidX=true
android.enableJetifier=true