Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 26, 2022 09:35 am GMT

WebRTC For Beginners - Part 5.5: Building the WebRTC Android Library

Contents:

  1. Part 1: Introduction to WebRTC and creating the signaling server
  2. Part 2: Understanding the MediaDevices API and getting access to the users media devices
  3. Part 3: Creating the peers and sending/receiving media
  4. Part 4: Sharing and sending the users display and changing tracks
  5. Part 5: Data Channels basics
  6. Part 6: Android native peer
  7. Part 7: iOS native peer
  8. Part 8: Where to go from here

Hello Again, sorry for the wait! Just thought I'd seperate the Android tutorial and the WebRTC Android build tutorial.

I tried using the prebuilt libraries from:
https://webrtc.github.io/webrtc-org/native-code/android/

But that didn't work so I decided to build it from scratch.
After trying for hours to build it on Arch Linux and failing I then found out you can only build Android on the following OS's:

ERROR: The only supported distros are    Ubuntu 14.04 LTS (trusty with EoL April 2022)    Ubuntu 16.04 LTS (xenial with EoL April 2024)    Ubuntu 18.04 LTS (bionic with EoL April 2028)    Ubuntu 20.04 LTS (focal with Eol April 2030)    Ubuntu 20.10 (groovy)    Debian 10 (buster) or later

Hopefully you don't make the same mistake I did. Hopefully the future me won't make the same mistake either!

Here I will show you how to build the Android library from scratch, I will show how to implement it into your own project next part.

Well then let's build the native Android WebRTC Library! Don't forget to check the OS your building on!

Setting up depot_tools

First we need to get the tools needed to build the library, this can be done via the following:

mkdir webrtc && cd webrtcgit clone https://chromium.googlesource.com/chromium/tools/depot_tools.gitexport PATH=/path/to/depot_tools:$PATH

Here we get the tools required to build the android library(and ios) and set the path.

Obtaining the WebRTC Android source

Next we need to get the WebRTC Android source and sync.

fetch --nohooks webrtc_androidgclient sync

Once we have the source we can update to the latest source via the following:

cd srcgit checkout maingit pull origin maingclient sync

As far as I'm aware sync must be done after and source updates.

Next we need to install the dependencies needed to build the libarary.

./build/install-build-deps.sh

Finally build the WebRTC Android library.
This part may take some time to complete so grab your favorite beverage and relax.

./tools_webrtc/android/build_aar.py 

Once done you should see the "libwebrtc.aar" file in the src directory.

TLDR

You can get the WebRTC Android library here:
https://github.com/ethand91/android_libwebrtc

Feel free to use it.

That concludes this small part, hopefully this is helpful to you.

Like me work? I post about a variety of topics, if you would like to see more please like and follow me.
Also I love coffee.

Buy Me A Coffee


Original Link: https://dev.to/ethand91/webrtc-for-beginners-part-55-building-the-webrtc-android-library-e8l

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To