WebRTC on Android

whitebear picture whitebear · Feb 28, 2014 · Viewed 26.1k times · Source

I would like to use WebRTC on Titanium. In the end of last year, WebRTC was implemented on Chrome for Android. I would like to make an application with WebRTC on Android.

I have a few questions:

  1. Is it possible to use WebRTC on native webview or it is only for chrome?
  2. What is the simplest way to implement webRTC on Android?

I have found the old article about webRTC on mobile here WebRTC on a standalone mobile app but it is old, how has the situation changed now?

Answer

GleasonK picture GleasonK · Aug 30, 2015

Just an update on WebRTC for those seeing this post later:

WebRTC Library

If you are only catering to Android L (5.0), you can use the updated WebView. I am not sure you can support older Android versions with a WebView though. You can take the native option of course.

As other users mentioned, compiling WebRTC source files is certainly a viable option if you have the time and resources. However, if you would like to get up and running faster, Pristine.io is dedicated to hosting up to date WebRTC Android artifacts. To begin using WebRTC natively on your Android, you can add the following to your app's build.gradle:

dependencies { 
   ... 
   compile 'io.pristine:libjingle:9694@aar' 
} 

At the time I am writing this, I have been working with WebRTC on Android for the past few months, and the most recent revision I have been using is 9694. Find the most recent revision here.

Getting Started on Android

As with WebRTC's javascript library, you will need a service to take care of user discovery and SDP signaling. I built a WebRTC Signaling API using PubNub for the signaling service. You can include it and begin to use it right away by adding the following to your app's build.gradle:

dependencies {
    ...
    compile 'io.pristine:libjingle:9694@aar'
    compile 'me.kevingleason:pnwebrtc:1.0.6@aar'
    compile 'com.pubnub:pubnub-android:3.7.4'    //optional
}

Additional Resources