Write Android apps using RTCMultiConnection

This documentation explains how to generate android APK files

RTCMultiConnection v3 supports cordova/ionic/phonegap (webviews).

For more information: docs/

Want to build iOS apps? Check this: Write iOS apps

Development Environment Prerequisites

Oracle Java Development Kit (JDK)
Apache Ant
Android SDK

For a clear (comprehensive) guide, please check: appache: installing-the-requirements

Check if your system is ready

cordova requirements

Above command will/should display a result similar to this:

Java JDK: installed
Android SDK: installed
Android target: installed android-23,Google Inc.:Google APIs:23
Gradle: installed ----------------- this one seems redundant

Please make sure to re-install the prerequisites if you get different result.

Create Your First Cordova App

cordova create RTCMultiConnection com.rtcmulticonnection.demo RTCMultiConnection
cd RTCMultiConnection

Now you need to change following files:

namepathdescriptiondemo file
index.html www/index.html Android app shows this HTML demo file
index.js www/js/index.js this is the backbone; here you do everything! demo file
config.xml config.xml here you set plugins, platforms, and attributes demo file
AndroidManifest.xml platforms/android/AndroidManifest.xml your android APK requires this file demo file

Modify index.html

<link type="text/css" href="css/index.css">
<script src="cordova.js"></script>
<script src="js/"></script>
<script src="js/RTCMultiConnection.js"></script>
<script src="js/index.js"></script>

Modify index.js

var app = {
    initialize: function() {
    bindEvents: function() {
        document.addEventListener('deviceready', app.onDeviceReady, false);
    onDeviceReady: function() {
        // here goes your real RTCMultiConnection codes
        var connection = new RTCMultiConnection();
        connection.socketURL = '';


Modify config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.rtcmulticonnection.demo" version="1.0.0" xmlns="" xmlns:cdv="">
    <icon src="www/img/icon.png" />
    <content src="index.html" />
    <allow-navigation href="*" />
    <allow-intent href="*" />
    <access origin="*" />

    <platform name="android">
        <preference name="Orientation" value="default" />
        <preference name="KeepRunning" value="true" />
        <preference name="AndroidLaunchMode" value="singleTop" />
    <preference name="xwalkVersion" value="23+" />
    <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
    <preference name="xwalkMode" value="embedded" />
    <preference name="xwalkMultipleApk" value="true" />

    <plugin name="cordova-plugin-whitelist" spec="latest" />
    <plugin name="cordova-plugin-device" spec="latest" />
    <plugin name="cordova-plugin-crosswalk-webview" spec="latest" />

Please modify following XML attributes:

descriptionexample code
"id" attribute: It should be something like this:
<widget id="com.yourdomain"
"name" attribute: Name should NOT have spaces or special characters. Consider it as a "username":
"icon" attribute: You can replace "icon.png" file with your own app-icon.

Modify AndroidManifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:versionName="1.0.0" package="com.rtcmulticonnection.demo">
    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MICROPHONE" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Add Android platform

cordova platform add android

Build Android

cordova build android

You can find the generated APK here: