OpenTok Android SDK – for building WebRTC movie apps on Android devices

OpenTok Android SDK – for building WebRTC movie apps on Android devices

OpenTok Android SDK

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

Overview

All OpenTok applications are composed of two parts:

  • The client-side, which uses the OpenTok client SDKs and runs in a user's browser or mobile app
  • The server-side, which uses the OpenTok server SDKs and runs on your server to pass authentication information to the client.

The client SDK for building Android apps is the OpenTok Android SDK, which provides most of the core functionality for your app, including:

  • Retrieving session information from your server
  • Initializing a session
  • Connecting to a session
  • Publishing rivulets to a session
  • Subscribing to rivulets in a session

Client SDKs are also available for iOS and web. All OpenTok client SDKs can interact with one another.

You can learn more about the basics of OpenTok clients, servers, sessions, and more on the OpenTok Basics page.

Learning to build with the OpenTok Android SDK

The best way to learn how to use the OpenTok Android SDK is to go after the OpenTok Basic Movie Talk tutorial:

Once you understand the basics of building with the OpenTok Android SDK, you can get more detailed information and learn how to customize your application with the OpenTok developer guides. To investigate specific API classes and methods, see the OpenTok Android SDK API reference.

Code samples

Interoperability

Apps written with the OpenTok Android SDK Two.11.1 can interoperate with OpenTok apps written with the following OpenTok SDKs:

Installation

The library (an aar file) is included in the root of the SDK bundle.

Developer and client requirements

The OpenTok Android SDK supports one published audio-video stream, one subscribed audio-video stream, and up to five extra subscribed audio-only flows at the same time (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 is supported on armeabi, armeabi-v7a, armeabi64-v8a, and x86 architectures.

The OpenTok Android SDK works with any Android Four.1+ device (Jelly Bean, API Level 16) that has a camera (for publishing movie) and adequate CPU and memory support.

Creating your own app using the OpenTok Android SDK

The library is provided in the opentok-android-sdk-2.11.1.aar file. You no longer need to include architecture-dependent .so files (which was required in previous versions). This file is included in the root of the SDK package. Place the aar file into your project in Android Studio. Then modify the gradle file for your project to reference the aar file.

A Maven version is available at https://bintray.com/tokbox/maven/opentok-android-sdk. The artifact ID is "opentok-android-sdk" . Modify your app to download the OpenTok Android SDK from http://tokbox.bintray.com/maven. For example:

Edit the build.gradle for your project and add the following code snippet to the allprojects/repositories section:

Modify build.gradle for your module and add the following code snippet to the 'dependencies' section:

Your app needs to use a session ID and token generated with your OpenTok API key, which you can get by logging into your TokBox account.

For test purposes, you can generate a session ID and token by logging into your TokBox account. For a production app, generate unique tokens (and session IDs, if you need to support numerous sessions) using the OpenTok server-side libraries.

Permissions

The OpenTok Android SDK uses following permissions:

You do not need to add these to your app manifest. The OpenTok SDK adds them automatically. However, if you use Android 21+, certain permissions require you to prompt the user.

Related video:

Leave a Reply

Your email address will not be published. Required fields are marked *