Opentok Android SDK Samples
Check documentation to understand Video API basic concepts. See instructions below in order to open Android project and set up the credentials.
The Android projects in this directory demonstrate typical use cases and features available in the OpenTok Android SDK:
- Basic-Video-Chat (Java, Kotlin) demonstrates how to publish and subscribe to streams in a session. Best place to start
- Simple-Multiparty (Java) demonstrates how to enable/disable audio/video streams and how to swap camera
- Multiparty-Constraint-Layout (Java, Kotlin) demonstrates how to use ConstraintLayout to position all the videos in a multiparty session
- Signaling (Java) demonstrates how to send text messages
- Archiving (Java, Kotlin) demonstrates how to utilize OpenTok server to start, stop, and playback session recordings
- Frame-Metadata (Java) demonstrates how to send and receive additional metadata associated with each video frame
- Basic-Video-Capturer (Java) demonstrates how to create a custom video capturer using Camera class
- Basic-Video-Capturer-Camera-2 (Java) demonstrates how to create a custom video capturer using Camera2 class
- Basic-Video-Renderer (Java) demonstrates how to create a custom video renderer
- Basic-Audio-Driver (Java, Kotlin) demonstrates how to publish a random audio signal and save audio streams to the file.
- Advanced-Audio-Driver (Java, Kotlin) demonstrates how to create a more advanced custom audio driver
- Basic-Video-Driver (Java) demonstrates how to create a custom video driver
- Live-Photo-Capture (Java, Kotlin) demonstrates how to capture an image from a subscribed video stream
- Picture-In-Picture (Java) demonstrates how to use the Picture-in-Picture mode
- Screen-Sharing (Java) demonstrates how to publish a screen-sharing video, using the WebView as the source
- Phone-Call-Detection (Java, Kotlin) demonstrates how to detect incoming and outgoing phone calls
- ARCore-Integration (Java) demonstrates how to use Google ARCore with Opentok
- Basic-VoIP-Call (Java) demonstrates how to use Android Connection Service (https://developer.android.com/reference/android/telecom/ConnectionService) with the OpenTok Android SDK.
Open project
- Clone this repository
[email protected]:opentok/opentok-android-sdk-samples.git
- Start Android Studio
- In the
Quick Start
panel, clickOpen an existing Android Studio Project
- Navigate to the repository folder, select the desired project subfolder, and click
Choose
Set up credentials
You will need a valid TokBox account for most of the sample projects. OpenTok credentials (API_KEY
, SESSION_ID
, TOKEN
) are stored inside OpenTokConfig
class. For these sample applications, credentials can be retrieved from the Dashboard and hardcoded in the application, however for a production environment server should provide these credentials (check Basic-Video-Chat project).
Note: To facilitate testing connect to the same session using OpenTok Playground (web client).
Development and Contributing
Feel free to copy and modify the source code herein for your projects. Please consider sharing your modifications with us, especially if they might benefit other developers using the OpenTok Android SDK. See the License for more information.
Interested in contributing? You ❤️ pull requests! See the Contribution guidelines.
Testing
Projects consistancy is qurded by separate test project located in the .test
directory. To run tests use these commands:
cd .test
./gradlew clean test
Getting Help
You love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
- Open an issue on this repository
- See https://support.tokbox.com/ for support options
- Tweet at us! We're @VonageDev on Twitter
- Or join the Vonage Developer Community Slack