Developer Tools

The Android SDK provides a collection of utility methods for layout adjustment, network diagnostics, outbound calling, audio-only mode, pre-call testing, background/foreground handling, and logging.

Layout

Adjust Layout

When using activeviews: "view" mode, the SDK manages the video grid layout automatically. Call adjustLayout() whenever the user rotates the screen or the view container is resized, so the grid reflows correctly to fit the new dimensions.

Method: EnxRoom.adjustLayout(int frameWidth, int frameHeight)

frameWidth Numeric — the new width of the layout container in pixels
frameHeight Numeric — the new height of the layout container in pixels
enxRoom.adjustLayout(width, height);
Network Diagnostics

Client Bitrate Test

Available from Android SDK 1.9.8 and later.

The EnxRtc.clientBitrate() method tests video and audio bandwidth against the EnableX TURN server for a specified region and returns a report. Use this as a quick pre-call bandwidth check to determine whether the connection is stable enough for video before joining a session.

Observer: EnxRtc.setEnxClientBitrateObserver(EnxClientBitrateObserver)
Method: EnxRtc.clientBitrate(JSONObject clientInfo)

Parameter: clientInfo.region — String, optional. Region ID for the ICE server. Accepted values: "IN", "SG", "US", "DE". Default: "DE".

Callbacks:

EnxRtc enxRtc = new EnxRtc();
enxRtc.setEnxClientBitrateObserver(this);

JSONObject clientInfo = new JSONObject();
clientInfo.put("region", "IN");
enxRtc.clientBitrate(clientInfo);

public void onClientBitrateStatus(JSONObject jsonObject) {
    // Intermediate test status
}

public void onClientBitrateFinished(JSONObject jsonObject) {
    // Final result — e.g.:
    // { "video": { "bitrate_bps": 2221949, "connection": "stable" },
    //   "audio": { "bitrate_bps": 278067, "connection": "stable" } }
}

public void onClientBitrateFailed(JSONObject jsonObject) {
    // Test failed
}

Pre-Call Diagnostics

Available from Android SDK 1.9.6 and later.

The EnxRtc.clientDiagnostics() method detects issues that could prevent RTC from working correctly. It runs a configurable battery of tests — including media device checks, connectivity verification, and network quality measurement — and delivers results via callbacks as each test group starts and finishes. The complete diagnostic report is delivered when all selected tests complete.

Observer: EnxRtc.setEnxTroubleShooterObserver(EnxTroubleShooterObserver)
Method: EnxRtc.clientDiagnostics(JSONObject Options)

Run this in a lobby or waiting room to catch problems — blocked UDP ports, insufficient bandwidth, missing media permissions — before they affect the call experience.

enxRtc.setEnxTroubleShooterObserver(this);
enxRtc.clientDiagnostics(options);
Outbound Calls

Dial Out to Phone or SIP

Outbound calling lets you dial a PSTN phone number or SIP URI from within an active video session. When the called party answers, they are joined into the room as a participant. This is useful for bridging traditional phone users into video meetings without requiring them to install any application.

Use makeOutboundCall to dial a single number, or makeOutboundCalls to dial up to five numbers simultaneously.

Methods:

enxRoom.makeOutboundCall("PSTN_OR_SIP_NUMBER", "CLI_NUMBER", dialOptions);

Cancel an Outbound Call

Available from Android SDK 2.1.3 and later.

Cancel an outbound call that has been initiated but not yet answered. Use this if the local user decides to abort the dial before the remote party picks up.

Method: EnxRoom.cancelOutboundCall(String number)
Delegate: onOutBoundCallCancel — notifies the call initiator when the participant has been disconnected as a result of the cancellation

Send DTMF Response

Available from Android SDK v2.3.16 and later.

Send DTMF (Dual-Tone Multi-Frequency) tones through an active outbound PSTN call that is connected to an IVR system. Use this to navigate IVR menus programmatically on behalf of the caller.

Method: EnxRoom.sendDTMF(String number, String digits)

Session Modes

Audio Only Mode

Switch the session into audio-only mode to stop sending and receiving video entirely. This is useful on poor network connections where video is causing quality degradation. Pass false to restore video when conditions improve.

Method: EnxRoom.setAudioOnlyMode(boolean AudioOnly)

enxRoom.setAudioOnlyMode(true);   // Switch to audio-only
enxRoom.setAudioOnlyMode(false);  // Restore video
Stream Configuration

Update Stream Configuration

Available from Android SDK 1.5.6 and later.

Reconfigure a published local stream at runtime without disconnecting. Use updateConfiguration() to add new stream attributes or update existing ones — for example, to adapt bandwidth limits to changing network conditions.

Method: EnxStream.updateConfiguration(JSONObject streamOpt)

Application Lifecycle

Moving to Background

Android restricts camera and microphone access when your app moves to the background. Call stopVideoTracksOnApplicationBackground() from your Activity.onPause() to stop video tracks and prevent black frames or frozen video for remote participants.

Method: EnxRoom.stopVideoTracksOnApplicationBackground(localMuteState, remoteMuteState)

enxRoom.stopVideoTracksOnApplicationBackground(localMuteState, remoteMuteState);

Moving to Foreground

Restore video tracks when the app returns to the foreground. Call startVideoTracksOnApplicationForeground() from your Activity.onResume() to resume publishing and receiving video after returning from the background.

Method: EnxRoom.startVideoTracksOnApplicationForeground(localUnmuteState, remoteUnmuteState)

enxRoom.startVideoTracksOnApplicationForeground(localUnmuteState, remoteUnmuteState);
Device Utilities

Proximity Sensor

Enable the device proximity sensor to automatically switch audio output routing. When the phone is held up to the ear, audio is routed to the earpiece speaker; when held away, it switches back to the loudspeaker. This mirrors the behavior of native phone calls and is useful for voice-centric sessions.

Method: EnxRoom.enableProximitySensor(boolean status)

Take a Video Snapshot

Capture a static image snapshot of the video currently rendering in a stream. The snapshot is returned as a Bitmap that you can display, save, or share within your application.

Method: EnxRoom.captureScreenShot(EnxScreenShotObserver enxScreenShotObserver)

Audio Device Updates

The SDK notifies your application when the set of available audio devices changes — for example, when a Bluetooth headset connects or disconnects, or when headphones are plugged in or removed. Implement these callbacks to update your audio routing UI in response to device changes.

Callbacks:

Logging

Enable Console Logging

Enable or disable SDK console logging. Turn this on during development to see detailed SDK activity in Logcat. Disable in production builds to reduce log noise and avoid leaking internal details.

Method: EnxRoom.enableLogs(boolean isEnable)

Share Log with EnableX

Upload the recent SDK console log to the EnableX support team for remote troubleshooting. Use this when a user reports a problem — the uploaded logs give the EnableX support team the context they need to diagnose the issue without requiring a local reproduction.

Method: EnxRoom.postClientLogs()