Java

Setting Up Authentication

In order to connect to a Vonage Video session, the client will need access to some authentication credentials — an App ID, Session ID, and Token.

In a production application, these credentials should be generated using a Server SDKs, but to speed things up we will hard code the values for now.

  1. Create a new Java class called VonageVideoSDKConfig in the same folder as the MainActivity.java file.
  2. Start by copying the following code block and adding it to your VonageVideoSDKConfig class:
    public class VonageVideoSDKConfig {
        // Replace with a Application ID
        public static final String APP_ID = "YOUR_APP_ID";
    
        // Replace with a generated Session ID
        public static final String SESSION_ID = "YOUR_SESSION_ID";
    
        // Replace with a generated token (from the dashboard or using an OpenTok server SDK)
        public static final String TOKEN = "YOUR_TOKEN";
    }
    
  3. Go ahead and replace YOUR_APP_ID with the application ID we generated earlier.
  4. Log into your your Vonage Dashboard and navigate to the Video Playground. It is under Troubleshoot & Learn - Developer Tools - Video - Playground.
  5. Make sure that the "Create a new session" tab is selected at the top.
  6. Select "Yes" under "Have a specific Application ID?"
  7. Paste in the Application ID you generated before into the "Application ID" box that appears.
  8. Leave everything else as-is, and click "Create Session".
  9. On the next page that appears, copy the "SESSION ID".
  10. In VonageVideoSDKConfig.java, replace YOUR_SESSION_ID with the session ID we just copied.
  11. Click the "Connect" button at the top.
  12. Expand the "Session and token info" section at the top.
  13. Copy the "TOKEN" that was generated
  14. In VonageVideoSDKConfig.java, replace YOUR_TOKEN with the token we just copied.
  15. Save the VonageVideoSDKConfig.java file.

Important: You can continue to get the session ID and token values from your Account during testing and development, but before you go into production you must set up a server.

This information will allow our client-side code to talk to the Vonage Video API.

Basic text chat

Follow this tutorial to build basic text chat from scratch using the Vonage Video API. It is the quickest way to build a proof of concept for this functionality on the video platform.

Steps
1
Overview
2
Before You Begin
3
Configure a Vonage Video Application
4
Creating the Project
5
Setting Up Authentication
6
Connecting to the Session
7
Sending a Signal
8
Receiving a Signal
9
Testing your Code
10
Conclusion