Migrate from Twilio Video to EnableX

Migration Guide from Twilio to EnableX: Android SDK

Android SDK

Introduction

This guide is designed to help you transition from your current Twilio Video setup to the EnableX Android Video SDK documentation. For those starting a new project, we recommend consulting the EnableX Video SDK documentation for guidance. We ensure a smooth transition for all Twilio users looking to switch to a reliable alternative without any hassle. Begin with a free trial and experience the ease of integration firsthand.

Quick Start with EnableX Android Video Sample Applications

Explore a variety of sample applications tailored for different programming environments, including Java and Kotlin. Each sample app is available on GitHub, providing practical examples to kickstart your video calling project.

Video Calling QuickStart documentation - iOS

Step 1: Begin with EnableX

Start Your Free Trial in Minutes

We’ve got you covered with a migration path that feels familiar yet innovative.

  • Sign Up Easily: Go to the EnableX portal and select Try for Free.
  • Quick Registration: Provide your details; name, phone number, company, email and agree to the Terms of Service.
  • Account Verification: Check your email and click the verification link.
Try for Free

Step 2: Set Up Your Video Calling Project

Step 3: Integrate EnableX on the Client Side

Developer's Corner: Build Your Way

For integrating EnableX SDKs into your Android app:

<uses-permission android:name="android.permission.CAMERA"/>
                    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
                    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
                    <uses-permission android:name="android.permission.INTERNET" />
                    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
                    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
                    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
                    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
                    <uses-permission android:name="android.permission.BLUETOOTH"/>
                    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-feature android:name="android.hardware.camera"/>
                    <uses-feature android:name="android.hardware.camera.autofocus"/>
                    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>

Step 4: Start and Join Sessions

Download the EnableX Web SDK and extract the contents from the zip file. Then, save the extracted files to your hosting server or the designated directory in your project structure.

Twilio
// Join room
                    val connectOptions = ConnectOptions.Builder(joinToken)
                        .videoTracks(localVideoTracks)
                        .audioTracks(localAudioTracks)
                        .roomName(sessionId)
                        .build()
                    
                    Video.connect(context, connectOptions, roomListener)
Start and join Session with EnableX
  1. 1. Initialize and Join Room
    • Create an EnxRtc instance and pass the required observers.
    • EnxRtc enxRtc = new EnxRtc(getActivity(), EnxRoomObserver,
                                       EnxStreamObserver, EnxAdvancedOptionsObserver;
    • Join the room using a token and publish your local streams.
    • EnxStream vcxLocalStream = enxRtc.joinRoom(token, publishStreamInfo,
                                       roomInfo, advanceOptionsInfo);
  2. 2. Handle Room Connection
    • On successful connection, use the callback onRoomConnect to publish your stream.
    enxRoom.publish(vcxLocalStream);
  3. 3. Attach Renderer to Local Stream
    • Create an EnxPlayerView and attach it to the local stream.
    EnxPlayerView enxPlayerView = new EnxPlayerView(getActivity(),
                                 EnxPlayerView.ScalingType.SCALE_ASPECT_BALANCED, true);
                                vcxLocalStream.attachRenderer(enxPlayerView);
  4. 4. Subscribe to Remote Streams
    • When the onStreamAdded event is triggered, subscribe to the incoming streams.
    enxRoom.subscribe(streams);
  5. 5. Handle Active Talkers
    • Manage the display of active talkers, either through a list of streams or a complete view.
  6. 6. End the Call
    • Use room.disconnect () or room.destroy () to end the call. disconnect leaves the room while others may continue;
      destroy terminates the session entirely.