Native Android WebRTC application development
Asked Answered
P

5

31

I am trying to create an android application for video chat and messaging by using WebRTC Native APIs. I have been through several links and found out that most of the documentation for android is vague, specially if you dont know where to start from. I followed the following links,

https://webrtc.org/native-code/android/#

https://www.chromium.org/developers/how-tos/android-build-instructions

But the above mentioned links doesnt make any sense because I want to develop an android application and these links suggests downloading a chromium and then build that. I know the end result is going to be an apk but what if I want to code my self. I looked into pubnub and OpenTokRTC as well but I dont want to use somebody elses signaling service either (along with pub and sub keys). I tried the following link,

https://github.com/pristineio/webrtc-build-scripts

but this seems to be a bit incomplete for a novice in WebRTC as well since it suggests to get the WebRTC by the following command,

# Pull WebRTC
get_webrtc

Finally I have tried the following link,

http://simonguest.com/2013/08/06/building-a-webrtc-client-for-android/

But the problem with this tutorial is that its not updated at all. Libjingle has been moved to github by now and I dont know how to use gclient to get libjingle from github.

This struggle of mine has been a disaster. Can anyone please help me in something with updated documentation or tutorial which I can use for understanding as to what exactly do I need to develop an application using webRTC native APIs? Please do not give me any links to OpenTokRtc or PubNub.

Thanks

Psalm answered 24/4, 2016 at 22:55 Comment(9)
Are you able disconnect call without application close?Faucher
Have you find any solution yet? I'm having the same issueLiftoff
Best way would be perhaps to build a chromium so that you can make up your own apk. And then try getting a free signaling service or write one. Or go for libjingle so that you can make up your own stuff.Psalm
@Psalm Were you able to finish the project or get some reference??Exchange
Unfortunately no.....Psalm
Hi Ahmed would you please share us how did you solve the issue finally?Laddie
What are you trying to accomplish?Psalm
I want to develop an application using webRTC native apis. If you are already found a good documentation or tutorial or example then would you please share it here? @Psalm ThanksLaddie
@Ahmed, I think this will help to compile and build native libraries: github.com/mail2chromium/Android-Native-Development-For-WebRTCLongford
K
12

I know this is an old thread, but in case anyone is still searching for a way to build Android apps with libjingle, prebuilt libraries have been published within the last few months that can be added as dependencies very simply to Android Studio projects like so:

dependencies {
    compile 'org.webrtc:google-webrtc:1.0.+'
}

In Android Studio 2. Or for Android Studio 3:

dependencies {
    implementation 'org.webrtc:google-webrtc:1.0.+'
}

Documentation is here. For an example of how to use the Android API, read through the AppRTC code.

Kathaleenkatharevusa answered 26/1, 2018 at 17:19 Comment(6)
is the sections Getting the Code, Compiling necessary as it again points to webrtc.org/native-code/development/prerequisite-sw and to whole Chromium build ?Hoffer
If you just want to use the Android API then adding the above lines to build.gradle is all you have to do. No need to compile the library yourself unless you have more specific needsKathaleenkatharevusa
@Kathaleenkatharevusa Do you know any tutorials or sample projects which are easier than this provided on their site? It is a little bit complicated and the documentation is not very helpful. I am looking forward to understanding this lib and do something with this but unfortunately, there is lack of information.Abnormity
@Abnormity The AppRTC code I shared above is the only correct example of using the current Android API that I'm aware of. The library is definitely a little complicated, especially since most of the documentation lives in the native C++ library. I'd highly recommend starting by copying the webrtc code from AppRTC and modifying from there.Kathaleenkatharevusa
This is the correct answer. Moreover, a sample project based on AppRTC code and updated for Oreo can be found here.Truckload
That library is meant only for development purposeParson
W
5

@Mark Sherman gave a good answer on how to get the libjingle lib into compiling into your project. You will still need to come up with your own signaling service. The project I found helpful which includes an Android Client and service is the following:

Client - https://github.com/pchab/AndroidRTC

Signaling - https://github.com/pchab/ProjectRTC

You can also check out Ericsson's cross platform extensive SDK called OpenWebRTC:

http://www.openwebrtc.org/

https://github.com/EricssonResearch/openwebrtc-android-sdk

Whistling answered 19/5, 2016 at 5:52 Comment(0)
G
3

I am also in the same situation as you are, finding how to integrate my own signalling service into libjingle and there seems to be no tutorial out there addressing it.

If you are using Android Studio for your development, you should include compile 'io.pristine:libjingle:9694@aar' in the dependencies section of your build.gradle script:

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   compile 'io.pristine:libjingle:9694@aar'
   // the rest of your code
}

This should add libjingle to your project.

Gainor answered 28/4, 2016 at 14:14 Comment(1)
Hi, I want to add authentication of user to connect to my existing WebRTC server. I am able to connect through Webpage and can make calls through it. Do u have any Sample to Help to work like that for Android ??Bevon
D
3

I'm using the library that Mark Sherman mentions. There is a blog post that explains very well all the classes involved in the process: tech.appear.in

NOTE: It doesn't explain anything about signalling servers but introduces you to it.

Also, the AppRTCDemo code available at chromium.googlesource.com can be a good trusted resource to check the workflow. It is a bit complex but if you know what you're looking for it can be useful.

Daughtry answered 3/5, 2016 at 16:2 Comment(4)
Hi, I want to add authentication of user to connect to my existing WebRTC server. I am able to connect through Webpage and can make calls through it. Do u have any Sample to Help to work like that ??Bevon
@ForGuru What do you mean exactly? Like a login? In that case use a database for it.Ribbon
I have a FreeSwitch Based VoIP server working. Which now works with SIP User ID and Password. We have installed WebRTC Module on it and we can connect through WebRTC Client in Chrome. I want to add User Name and Password Authentication in Android AppRTC sample App to connect to my ServerBevon
@ForGuru Does not part of webrtc itself. I suggest you create a question about it. I cannot help you.Ribbon
N
1

If you wan't a full end to end open source implementation I would look at this library... https://github.com/nhancv/nc-kurento-android

That paired with Kurento (https://github.com/kurento) and included demos will pretty much show you how everything works under the hood. I used this as a starting point for my own webrtc project and it was relatively easy to follow and thorough, although there will still be a learning curve of course.

Nodose answered 21/2, 2020 at 0:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.