Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC on Android

Tags:

android

webrtc

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?

like image 632
whitebear Avatar asked Feb 28 '14 02:02

whitebear


1 Answers

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

  • Signaling API Documentation
  • Sample Android WebRTC App
  • Tutorial on making an Android WebRTC app with signaling library
like image 141
GleasonK Avatar answered Nov 14 '22 19:11

GleasonK