Import Android-SDK

Download SDK

Download the Android-SDK and WebRTC library then copy it to app/libs .

https://ecocdn.net/android_sdk/p2p.jar
https://ecocdn.net/android_sdk/webrtc.aar

Modify build.gradle

Add the following code to your application's build.gradle app/build.gradle :

android {
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}

Besides add new dependencies in app/build.gradle as shown below:

dependencies {
    implementation 'com.alibaba:fastjson:1.2.58'
    implementation 'org.java-websocket:Java-WebSocket:1.5.1'   // Need latest version to avoid crash
    implementation 'com.orhanobut:logger:2.2.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.13'       // Or higher OkHttp version
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    compile(name:'webrtc', ext:'aar')
}

Last updated

Was this helpful?