How to build Android WebRTC Mobile app



WebRTC (Web Real-Time Communication) is a free, open-source project that provides web browsers and mobile applications with real-time communication (RTC) via simple application programming interfaces (APIs). It allows audio and video communication to work inside web pages by allowing direct peer-to-peer communication, eliminating the need to install plugins or download native apps.

The official WebRTC provides native code of Android and iOS examples.

Build environment:

  • Ubuntu 16.04
  • Android Studio 3.x or higher
  • System Python 2.x (3.x or Anaconda python may fail)
  • Git

Install Prerequisite Software:

We are going to use  depot_tools  which includes the tools such as gclient, gcl, git-cl and repo. See  Install depot tools  for more information. Now let's clone the tool.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Add  depot_tools  to the end of your PATH (you will probably want to put this in your  ~/.bashrc  or  ~/.zshrc ). Assuming you cloned depot_tools to /path/to/depot_tools:
$ export PATH=$PATH:/path/to/depot_tools

Get the code:

Create a working directory, enter it, and run:
fetch --nohooks webrtc_android
gclient sync
You can type  gclient sync  command again if code synchronizing is interrupted.

Setup the environment:

cd src/
 ./build/install-build-deps.sh
 ./build/install-build-deps-android.sh

Compile:

This step will take a while and take up to 2x GB to build the files.
gn gen out/Debug --args='target_os="android" target_cpu="arm"'

You can specify a directory of your own choice instead of out/Debug, to enable managing multiple configurations in parallel.
  • To build for ARM64: use  target_cpu="arm64" .
  • To build for 32-bit x86: use  target_cpu="x86" .
  • To build for 64-bit x64: use  target_cpu="x64" .
Compile using:
ninja -C out/Debug
ninja -C out/Debug AppRTCMobile
Generate the project files:
build/android/gradle/generate_gradle.py --output-directory $PWD/out/Debug --target "//examples:AppRTCMobile" --use-gradle-process-resources --split-projects --canary
If you want to clean built files, run this:
gn clean out/Default

Import project in Android Studio: 

Import the project in Android Studio. (Do not just open it.) The project is located in out/Debug/gradle. If asked which SDK to use, choose to use Android Studio's SDK. When asked whether to use the Gradle wrapper, press “OK”.

Test the App: 

We are going to use https://appr.tc/ to test the communication.
Open it in a new tab. Next, either enter a specific string or choose random number as  room id  and then press JOIN. The browser will ask you for permissions of microphone and camera. Click Yes. On app side, enter the  room id  you are in. Press the call button to check whether or not it is working.

 

AppRTC parameters

You can add extra parameters to the link. Go to the AppRTC parameters for more information and usages

Tutorials:

There are some tutorials with good explanation for beginners to learn WebRTC.

Off-the-shelf projects on GitHub:

References:

Share:

7 則留言:

  1. You have mentioned valuable information about the mobile app so we are pleased. Now we have to go for trending On demand mobile apps in 2020 like teleconferencing, food, laundry, pharmacy, grocery, apparel, or the healthcare industry, etc.

    回覆刪除
    回覆
    1. How To Build Android Webrtc Mobile App >>>>> Download Now

      >>>>> Download Full

      How To Build Android Webrtc Mobile App >>>>> Download LINK

      >>>>> Download Now

      How To Build Android Webrtc Mobile App >>>>> Download Full

      >>>>> Download LINK Yn

      刪除
  2. An unstoppable fun game Hens revenge arcade game! Unique gameplay. Cutest bird game with Super Addictive arcade game ever. https://play.google.com/store/apps/details?id=com.okpogame.hensrevenge

    回覆刪除
  3. Thank you for sharing such a beautiful information.I hope you will keep sharing such wonderful information in future.It is amazing and wonderful to visit your site.

    Mobile app development

    回覆刪除
  4. Are you know about the Importance Of Real-time Features In Mobile App. Here we will share with you When you integrate real-time features on your apps and their importance.

    回覆刪除
  5. How To Build Android Webrtc Mobile App >>>>> Download Now

    >>>>> Download Full

    How To Build Android Webrtc Mobile App >>>>> Download LINK

    >>>>> Download Now

    How To Build Android Webrtc Mobile App >>>>> Download Full

    >>>>> Download LINK

    回覆刪除