Andrii Sergiienko

Software developer, Entrepreneur, Author

Building WebRTC demo for Android

Oct 6, 18:45

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.
2.Install 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

export ANDROID_HOME=`pwd`/adt-bundle-linux-x86_64-20140702/sdk


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

3.Build it!

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

OpenWebRTC — WebRTC implementation from Ericsson

Oct 2, 18:30

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.

Welcome, Ericsson.

How to remove iOS simulator

Sep 20, 20:01

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:

  1. sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
  2. rm -rf /Users/andreysergienko/Library/Caches/com.apple.dt.Xcode/Downloads/iPhoneSimulator7.1.sdk
  3. restart XCode

Configuring SFTP only user access on Ubuntu

Jul 28, 18:38

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.

Building Erlang development environment for Windows

Jul 27, 10:47
  1. download Erlang for Windows and install it
  2. add path to Erlang bin directory (i.e. c:\Program Files\erl6.1\bin) to the system PATH variable
  3. download Git for Windows
  4. install Git for Windows — when installing, choose Use Git from Windows Command Prompt option
  5. go to a temporary folder
  6. in the command line execute git clone git@github.com:rebar/rebar.git — it will download Rebar Erlang build tool
  7. now go to rebar folder and execute bootstrap.bat — it will build Rebar tool
  8. 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.

Ctrl + ↓ Earlier