githubEdit

Using a WebView

When embedding Whereby in a WebView, you will have access to all features available on the web, directly within your Android app. While it is relatively simple to build a basic app this way, please note that it comes with certain limitations, such as restricted background mode support, additional logic required for file sharing, etc.

circle-info

We offer an Android SDK that is a wrapper around a WebView and allows you to tap into powerful features such as listening to room events and using custom buttons to send commands to the room from your application. It also already handles the media permissions.

Quickstart guide

This guide shows you how to embed a Whereby room in a native Android app using a WebView. After that, it also introduces some customization options to give you an idea of what’s available. For a complete running example, check out our Android WebView demo apparrow-up-right repository.

Prerequisites

This guide assumes that you’ve already created a Whereby Embedded account and a meeting room. If you’ve not already taken these steps, you can do so by following the Whereby Embedded initial setup guide.

When embedding Whereby in a WebView, depending on your implementation, you can use the following types of URLs:

  • A Whereby room URL (which takes the user directly to the Whereby pre-call screen).

  • A custom web app that embeds Whereby using the Embedded element.

  • A React app that embeds Whereby with the React Hooks SDK.

Setting up the app

To start, open the latest version of Android Studio and create a new project with an empty Activity, keeping the recommended settings.

Setting the required permissions

To run a Whereby instance on Android, you must grant a set of permissions — including access to the device’s camera, internet connectivity, audio settings, and recording capabilities. Additional permissions may be required if, for example, you need to store shared files; however, these are not covered in this guide.

Add the following permissions to your app's manifest file:

Implementing the main activity

Replace the app's main Activity with the code below and update the URL in the example to your own Whereby room URL or web app URL.

Testing the app

Run the app in Android Studio, and you should see your Whereby instance running, allowing you to join the room with both camera and microphone enabled.

circle-info

This is a minimal implementation that sticks to the default behavior of WebView. It is recommended to extend the configuration to improve the user experience. For example, you can:

  • Enable and manage file sharing.

  • Handle external link redirections.

For a complete example that support both Activity and Fragment, check out our public repository: android-webview-demoarrow-up-right.


Customizing your app

Now that you’ve got a basic app running, you’ll want to customize it to your liking. Whereby has many options for customizing your app:

In this section, we’ll go through a couple of options to give you an idea of what’s available.

Setting custom brand colors

  1. In your account dashboard: Go to the Configure screen and access the Appearance panel.

  2. Set new primary, secondary, and focus highlight colors.

  3. Set a new background color, and upload a background image.

  4. Upload a company logo.

  5. Re-run your app to see how these settings change the look and feel.

Setting web component attributes

There are many different attributes you can set on the web component to configure various aspects of the video call experience. Let's add some to the room URL:

The effect of the attributes is as follows:

  • skipMediaPermissionPrompt: Skip the screen prompting the user to grant permission, as this can is already handled in the code.

  • minimal: Uses the minimal Whereby UI.

Save your code and re-run your app to see the effect of the attributes.

See also

Last updated

Was this helpful?