How to build a Video Conferencing App for Android with EnableX APIs

Video Conferencing Infrastructure

Understanding EnableX

Prerequisites

  1. A basic-to-intermediate understanding of Java and Android SDK
  2. EnableX App Credentials: Create an EnableX.io developer’s account.
    Once registered, create a project and get App credentials containing APP_ID and APP_KEY generated against the project.
  3. Android Studio 3 or above and Android devices 6 or above.
  4. Download the latest version of EnableX Android SDK.
  1. EnxRtc: This Class contains methods to connect to a room and join the room.
  2. EnxRoom: This Class contains methods to handle operations within a room. e.g. connection of End-Points to EnableX Room, publishing & subscribing to streams etc.
  3. EnxStream: This Class handles all Media Stream related functions. For e.g., initiate, configure and transport streams to and from EnableX Media Servers, receive stream to be played etc.
  4. EnxPlayerView: This Class is used to display the video stream on a EnxPlayerview.

Let’s Start Building

  1. Set Up New Project

3. Integrate the SDK

  • Initialize enableX SDK by creating EnxRtc object
    Create an instance of EnxRtc Class to initialize the EnableX SDK.
  • Parameters:
  • Join the Room
    Execute joinRoom() method on enxrtc instance to join the video conference. JoinRoom() method returns local stream instance which is used to publish the user’s local media in the Room. This basically means that once the user has joined the video conference, her video/audio stream becomes available to everyone in the conference.
  • – mToken: The token as received in Step 4 above.
  • – mPublishStreamInfo: Event listener for events related to the media stream in the Room.
  • Setup local video stream
    To start a local video (that is to see yourself on the screen), you need to get enxplayerview instance from local stream and add this enxplayerview into your view which is defined in xml.
  • Publish local stream
    Use enxRoom.publish(localStream) method to publish local stream to the connected roomAfter the user is connected to the Room, you can call the publish () method in the callback onRoomConnected(EnxRoom enxRoom, JSONObject roomMetaData)Once the local stream is published to the Room, all participants are notified with callback onStreamAdded(EnxStream stream)
  • Subscribe remote stream
    So far, we have ensured that the user is connected to the Room and has published his/her local stream in the Room. Now the user must also receive media stream from other participants connected to the Room.They must subscribe to each stream individually to receive it.The publish () method triggers a callback onStreamAdded(EnxStream stream) notifying everyone that a new stream has entered the Room so to receive the stream you need to subscribe it using subscribe(remotestream) method.
  • Setup remote video stream
    EnableX SDK provides pre-defined Video Grid for playing all the Remote Streams received at the Client end point.The RecyclerView allows you to play the most active media streams (Active Talkers in the Room) in a rotating manner. The VideoConferenceActivity needs to implement EnxActiveTalkerViewObserver and set observer to handle active talker view by calling
    enxRoom.setActiveTalkerViewObserver(EnxActiveTalkerViewObserver enxActiveTalkerViewObserver)
  • Go to Android Studio.
  • Make sure your Android device is plugged in
  • Click on Run to build the application on your device.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jason Wills

Jason Wills

Hi there. I am a product specialist with great interest in WebRTC, mobile app development, and anything that is relating to producing engaging communications