Libjingle is a C++ library used to create peer-to-peer connections for voice-chat applications. It is included in WebRTC and bundled inside the Chromium source repository.
There are a couple of web pages with instructions out there about how to build the library for Android, but none of them seem complete.
This is where this post comes in.
The steps to build libjingle for Android would be these:
- Install depot tools - http://dev.chromium.org/developers/how-tos/install-depot-tools
- Install the prerequisite software - http://www.webrtc.org/native-code/development/prerequisite-sw
- Run the following commands to get the sources:
mkdir webrtc-checkout
cd webrtc-checkout
fetch webrtc
- Run the following commands to configure the build environment:
echo "target_os = ['android', 'unix']" >> .gclient
cd src
source ./build/android/envsetup.sh
export GYP_DEFINES="$GYP_DEFINES build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 OS=android"
./build/install-android-sdks.sh
gclient runhooks --force
-
Start the build for libjingle_peerconnection.so
ninja -C out/Debug libjingle_peerconnection_so
After the build is done you can check the resulting artifact in out/Debug/lib/.
To try out libjingle on Android you can compile the AppRTCDemo application:
ninja -C out/Debug AppRTCDemo
You will get an apk in out/Debug/apks, which you can install and then go to apprtc.appspot.com and create a video chat room, and then connect with the Android app.
A working video call should look like this:
References: