OpenTok Android SDK

The OpenTok Android SDK lets you use OpenTok-powered video sessions in apps you build for Android devices.

Apps written with the OpenTok Android SDK 2.5.0 can interoperates with OpenTok apps written with the following OpenTok SDKs:

Installation

The library binaries are included in the OpenTok/libs subdirectory of the SDK.

Developer and client requirements

The OpenTok Android SDK supports one published audio-video stream, one subscribed audio-video stream, and up to five additional subscribed audio-only streams simultaneously (this is the baseline support on a Samsung Galaxy S3). To connect more than two clients in a session using the OpenTok Android SDK, create a session that uses the OpenTok Media Router (a session with the media mode set to routed). See The OpenTok Media Router and media modes.

The SDK is supported on high-speed Wi-Fi and 4G LTE networks.

The OpenTok Android SDK 2.4 is expected to work with Android 4.0+ and devices from Samsung, Google Nexus, Motorola Moto, and LG Optimus families. The OpenTok Android SDK 2.4 also works on x86 devices.

Using the sample apps

For sample code, go to the opentok-android-sdk-samples repo at GitHub.

Creating your own app using the OpenTok Android SDK

To target ARM, add the following libraries to your project's build path:

  • opentok-android-sdk-2.5.0.jar
  • armeabi/libopentok.so

To target x86, add the following libraries to your project's build path:

  • opentok-android-sdk-2.5.0.jar
  • x86/libopentok.so

To target ARM and x86, add the following libraries to your project's build path:

  • opentok-android-sdk-2.5.0.jar
  • armeabi/libopentok.so
  • x86/libopentok.so

These are included in the OpenTok/libs subdirectory of the SDK. Copy the opentok-android-sdk-2.5.0.jar file into the 'libs' directory of your project in Android Studio. Then, add the armeabi directory, the x86/libopentok.so, or both into the 'jniLibs' directory of your project in Android Studio.

Also, you need to add the following permissions and features to your app manifest:

  • android.permission.CAMERA
  • android.permission.INTERNET
  • android.permission.RECORD_AUDIO
  • android.permission.WAKE_LOCK
  • android.permission.MODIFY_AUDIO_SETTINGS
  • android.hardware.camera
  • android.hardware.camera.autofocus

Your app needs to use a session ID and token generated with your OpenTok API key, which you can get at the OpenTok developer dashboard.

For test purposes, you can generate a session ID and token on the projects page of the OpenTok developer dashboard. For a production app, generate unique tokens (and session IDs, if you need to support multiple sessions) using the OpenTok server-side libraries.

Documentation

Reference documentation is available in the docs subdirectory of the SDK and at http://www.tokbox.com/opentok/libraries/client/android/reference/index.html.

More information

For a list of new features and known issues, see the release notes.

Was this page helpful? Yes No