Compile WebRTC For Android code in Ubuntu 14.04

Source: Internet
Author: User
Tags vps

Compile WebRTC For Android code in Ubuntu 14.04

Recently, a real-time communication project for audio and video chats was developed based on Google's open-source WebRTC project. Some problems were encountered during the download of WebRTC code, which was recorded here, we also hope to help the children's shoes who encounter similar problems while downloading and compiling WebRTC code.

1) Prepare the environment

1. Ubuntu 14.04 LTS System

2. it is very important to prepare a stable VPN or VPS with a high speed. Everyone understands that most download code failures are caused by failure to access the google service. (I used Digital Ocean. I tried a few VPNs before, but they all ended up failing. The eggs were broken, either unstable or slow, it takes up to 15 hours for the download to succeed)

3. Install and download $ tools required to compile webrtc code

A. jdk (my sun jdk1.6.0 _ 45)

Jdk download path: http://ghaffarian.net/downloads/Java/JDK/

Configure to Environment Variables

B. git (version 1.9.1)

Install: sudo apt-get install git

C. gclient

1. Install: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

2. configure it to environment variables. If you do not know how to configure it, google.

D. install the following tool (sudo apt-get install ..)

G ++ (>=4.2)

Python (>=2.4)

Libnss3-dev> = 3.12

Libasound2-dev

Libpulse-dev

Libjpeg62-dev

Libxv-dev

Libgtk2.0-dev

Libexpat1-dev

For 32-bit builds on a 64-bit system:

Lib32asound2-dev

Ia32-libs

2). Download the code

1. Synchronize WebRTC code

1. Create the WebRTC directory

Mkdir WebRTC

Cd WebRTC

2. initialize gclient

Gclient config http://webrtc.googlecode.com/svn/trunk

3. Configure the target system version

Echo "target_ OS = ['android', 'unix ']">. gclient

4. sync code

Gclient sync -- nohooks

(The code I synced is as large as 7.1G, including NDK, SDK, and other tools. Previously, VPN was used and VPS was used, it took more than six minutes ...... nima, domestic programmers are hard-pressed)

NOTE: If Still working on or other information appears for a long time, do not interrupt or close it. It is Still running. If it is interrupted, all previously downloaded items will be deleted, then you have to sync it again.

3) Compile the code

1. Set the compiling environment

1. cd trunk

2. source./build/android/envsetup. sh

3. export GYP_DEFINES = "$ GYP_DEFINES OS = android"

2. Download the packages or tools on which compilation depends (here a lot of things will be downloaded, such as Ant .)

./Build/install-build-deps.sh (under the trunk directory)

3. gclient runhooks -- force (download the required build File and other information for compilation)

4. Compile (in the trunk directory)

Compile Debug: ninja-C out/Debug

Compile the Release version: ninja-C out/Release

Based on the above steps, if the network can normally access the google service, there will generally be no other problems. If there is a problem, don't be afraid, generally, you can find the cause based on the error message. I don't know about google.

After the compilation is successful, you can see the corresponding demo installation package in the out/Debug or out/Release directory, such as the Debug directory, where there is a AppRTCDemo-debug.apk and WebRTCDemo-debug.apk

The code of the AppRTCDemo program is trunk/talk/examples/android /.

Note: What is the difference between AppRTCDemo and WebRTCDemo?

WebRTCDemo is only a point-to-point in the LAN. If you know the ip address and port number of the other party, you can fight against it without a server. AppTRCDemo requires a server, which can be a LAN or WAN.

AppRTCDemo project source code:

------------------------------------------ Split line ------------------------------------------

Free in http://linux.bkjia.com/

The username and password are both www.bkjia.com

Download the WebRTC For Android code in/June 14.04/June 15/June 15/Ubuntu

For the download method, see

------------------------------------------ Split line ------------------------------------------

WebRTC source code: (the code is not compiled before. It is estimated that the code is about 7.1 GB after compilation. Please download the code and compile it on your own). The latest code downloaded on April 9, is not GB before compilation, if someone cannot download the code for various reasons, back up one copy to the cloud disk.

Link: Click to open the link password: j5s4

The last one is provided, with a picture showing the truth.

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.