For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating Popin WebView into Your Android App

This guide walks you through the complete setup for embedding the Popin WebView with camera and microphone access into your Android application β€” now with automatic permission handling through onPermissionRequest.


πŸ› οΈ Prerequisites

Before you begin, make sure you have the following:

  • Android Studio (latest stable version)

  • Minimum SDK: 21 (Android 5.0, Lollipop)

  • A valid Popin token (Replace XXXXX in the sample code with your brand’s actual Popin token)


πŸ” Add Required Permissions

To enable video calling, add the following permissions in your AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<!-- Optional: for smoother video calls -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

🧱 Create the Call Activity

Create a new file named CallActivity.java in your app package, for example:

This activity embeds the Popin widget in a secure WebView and automatically handles camera and microphone permissions using onPermissionRequest.


πŸ“„ CallActivity.java


🧱 Layout XML

Create res/layout/activity_call.xml to define a fullscreen WebView with a close button.


πŸš€ Launching a Popin Call

Start the call by launching the CallActivity from any part of your app:


πŸ“ Final Notes

  • βœ… No need to manually request permissions β€” they’re automatically handled through onPermissionRequest.

  • πŸ” Replace XXXXX with your actual Popin token in the WebView URL.

  • 🎯 If the user denies permissions, the WebView will automatically prevent access to the camera/mic.

  • πŸ§ͺ Test across Android versions to ensure smooth permission flows.

Last updated