Get started with the Wowza Flowplayer Android SDK
This page describes how to get started with the Wowza Flowplayer Android SDK. We assume you understand Android development and are familiar with Android Studio and Gradle.
Before you begin, check these requirements. You can then start integrating the SDK framework into your Android projects. As part of this process, you have to first import the SDK, then configure your application-level settings.
Migrate from legacy to v2.0
There are several breaking changes to consider if migrating to v2.0 of the Wowza Flowplayer Android SDK. If migrating from an earlier version of the SDK, see our migration guide.
Import the Android SDK
Use this section to add the SDK to your existing Android project and to configure your project-level settings. We recommend using Gradle and the Maven Central repository to download the SDK's core and modules. To download the mavenCentral
dependency, use these steps.
- In Android Studio, open your application.
-
In the project-level
build.gradle
file, add the
mavenCentral
repository to theallprojects
script block:allprojects { repositories { mavenCentral() } }
-
Add the SDK as a dependency in the application-level
build.gradle
file. Replace the
X.X.X
version placeholder with the version information in this badge:dependencies { implementation 'com.flowplayer.android.player:flowplayer:X.X.X' }
Configure your application
To be able to compile and run your application using the Wowza Flowplayer Android SDK, complete the steps described in this section.
Set a minimum SDK version
The minimum SDK parameter defines the compatibility for your application on different Android devices. To work with this SDK, you must set the minimum SDK version to API level 19 (Android 4.4). Follow these steps to complete this task.
- In Android Studio, find the build.gradle file for you application-level module.
-
Add the following
minSdkVersion
configuration:android { defaultConfig { minSdkVersion 19 } }
Add Java 8 compatibility
The Wowza Flowplayer Android SDK is written using Java 8 language features. To make your project compatible with Java 8, ensure that you're compiling for Java 8 or above by following these steps.
- In Android Studio, find the build.gradle file for you application-level module.
-
Add the following
sourceCompatibility
andtargetCompatibility
:android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }
info
Setting sourceCompatibility
and targetCompatibility
to versions above Java 8 (for example, Java 11) is acceptable. Java maintains backwards compatibility, so features from Java 8 should work seamlessly on newer Java versions. Always test your application to ensure there aren't any unforeseen issues.
Update the AndroidManifest
Follow the steps in this section to update your app/manifests/AndroidManifest.xml. For more, check the AndroidManifest.xml included in our demo application.
-
To enable the player content, add a
<meta-data>
tag with your Wowza Flowplayer access token. For more information about getting an access token, see Create or revoke a player token in Wowza Video.<meta-data android:name="com.flowplayer.accessToken" android:value="[my-flowplayer-access-token]" />
-
In every
<activity>
element that contains the player, add the following configuration. This prevents the activity from being destroyed on orientation changes.android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
A correctly configured manifest file looks similar to this:
<application> <activity android:name="com.my.package.MyAwesomePlayerActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" /> <meta-data android:name="com.flowplayer.accessToken" android:value="[my-flowplayer-access-token]" /> </application>