In this short blog post I present a step-by-step instruction on how to build WebRTC demo application for Android platform. In my case I used Ubuntu 14 as development environment. Note that you should use 64-bit OS, otherwise you will have problems when compiling source codes.
1.Update and upgrade your system with new version of packages.
2.Install these packages (relevant for Ubuntu, but might different for our system): git, git-svn, subversion, g++, pkg-config, gtk+-2.0, libnss3-dev, libudev-dev, ant, gcc-multilib, lib32z1, lib32stdc++6
Next, you have to install Oracle JDK instead of the supplied by default with your OS. Moreover, you should use Java 1.6 — newer versions won't let you compile the source codes.
1.Download Oracle JDK 1.6. At this time, this JDK is placed in archive already. You also have to register on the Oracle's website to download JDK.
sudo mkdir –p /usr/lib/jvm cd /usr/lib/jvm && sudo /bin/sh ~/jdk-6u45-linux-x64.bin --noregister
3.Register JDK in the system
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 50000 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 50000 sudo update-alternatives --config javac sudo update-alternatives --config java cd /usr/lib sudo ln -s /usr/lib/jvm/jdk1.6.0_45 java-6-sun export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45/
Now, we need to get WebRTC source codes
1.Download and prepare Google Developer Tools
mkdir –p ~/dev && cd ~/dev git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=`pwd`/depot_tools:"$PATH"
2.Download WebRTC codes
gclient config http://webrtc.googlecode.com/svn/trunk echo "target_os = ['android', 'unix']" >> .gclient gclient sync
For building WebRTC application for Android you also need ADT (Android Developer Tools) to be installed
1.Download ADT from its homepage
2.Unpack the ADT archive
cd ~/dev unzip ~/adt-bundle-linux-x86_64-20140702.zip
3.Setup ANDROID_HOME environment variable
Now you can build WebRTC source codes and WebRTC demo application for Android
1.Prepare build dependencies
cd ~/dev/trunk source ./build/android/envsetup.sh
2.Configure build scripts
export GYP_DEFINES="$GYP_DEFINES build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 OS=android" gclient runhooks
ninja -C out/Debug -j 5 AppRTCDemo
That's all! Now, if everything was completed without errors, you have compiled and ready to use WebRTC demo application here: ~/dev/trunk/out/Debug/AppRTCDemo-debug.apk
Using ADB (an Android tool from Google's ADT), you can install the application on your device. Connect the device via USB to your machine, enable USB debug mode on the device. Then execute the following command to deploy the application on the device:
./adb install ~/dev/trunk/out/Debug/AppRTCDemo-debug.apk
Good news for the industry: Ericsson just presented its own implementation of WebRTC — OpenWebRTC
Ericsson also gets back to life their WebRTC oriented web browser, — Bowser. It is available for Android and iOS. Moreover, it is open sourced now.
Bowser is still the only native web browser for iOS that supports WebRTC.
For a long time there was no any certain information on possible support of WebRTC for Apple devices. We expected that in iOS 8 — it didn't happen. Although, we have something new: using the Ericsson implementation, Safari also can support WebRTC now, — via browser extension.
Now, it seems that we have one more big player on the industry and one more stack implementation.
Tried to install previous version of iOS simulator, but the downed process failed and nothing has been installed. Nevertheless, Xcode now shows that I have iOS simulator installed.
To remove the problematic simulator from XCode:
- sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
- rm -rf /Users/andreysergienko/Library/Caches/com.apple.dt.Xcode/Downloads/iPhoneSimulator7.1.sdk
- restart XCode
Let's say we want to configure SFTP access for a user. We want the user to be able using SFTP (i.e. download/upload files on his WWW folder), but we don't want him to login over SSH and execute any commands on the server.
Edit /etc/ssh/sshd_config file and add the following at the end:
Match Group sftpusers ChrootDirectory /home/%u ForceCommand internal-sftp
Restart SSH: sudo service ssh restart
Add sftpusers group: sudo groupadd sftpusers
Add a user if necessary, and put it to sftpusers group: sudo usermod -a -G sftpusers %username%
Disable login to console for the user: sudo usermod -s /bin/false %username%
Now, the user will be able to connect using SFTP and do file operations using programs like WinSCP, but it will be unable to login over SSH and execute any commands on the server.
- download Erlang for Windows and install it
- add path to Erlang bin directory (i.e. c:\Program Files\erl6.1\bin) to the system PATH variable
- download Git for Windows
- install Git for Windows — when installing, choose Use Git from Windows Command Prompt option
- go to a temporary folder
- in the command line execute git clone email@example.com:rebar/rebar.git — it will download Rebar Erlang build tool
- now go to rebar folder and execute bootstrap.bat — it will build Rebar tool
- copy rebar and rebar.cmd files from the rebar folder to the Erlang bin folder (i.e. c:\Program Files\erl6.1\bin)
Now you have installed Erlang, Git and Rebar.