Recently, thanks to Mutual Mobile, the Pristine developers were invited to present at the Google Developer Group here in Austin, TX about our WebRTC solution for Google Glass. In preparation for our presentation, we have reflected on some of the pain points we have endured and poured over our existing solutions to provide a general guide for developing native applications with WebRTC on Android. We decided to start with the build process of WebRTC.

Understanding the Build Process

Unlike the browser applications using WebRTC, native Android applications require a manual build of the WebRTC libraries from source. It helpful to know what exactly is happening throughout the build process so here is our breakdown:

  1. Updating depot_tools
  2. Pulling the latest WebRTC changes
  3. Setting your build flags
  4. Set up the build environment for Android
  5. Execute your build

Our Build Scripts

We literally build the WebRTC libraries everyday and because it can be a little tricky to get right we decided to script everything out. We decided to open source these scripts and will be rolling out updates over the next couple weeks to include iOS. You can find the repository on Github

Getting Started (UPDATED 10/23/2014)

You should only need Ubuntu 12.04 on a 64 bit machine to get going.

This is only required once.

# Source all the routinessource android/build.sh# Install any dependencies neededinstall_dependencies# Setup jdkinstall_jdk1_6

Then you can build the libraries

# Pull down the latest WebRTC Sourceget_webrtc# Build apprtcbuild_apprtc# Build in debug modebuild_debug_apprtc

When the scripts are done you can find the .jar and .so file in $WEBRTC_HOME under "libjingle_peerconnection_builds".

Happy building!