This SDK provides an easy-to-integrate solution for embedding the Pagecall webapp into your Android applications using the PagecallWebView class, which extends the native WebView class. With the added bridge between WebView and the native environment, we enable seamless audio functionality for an enhanced user experience.
For other platforms, please refer to https://docs.pagecall.com
- Android API level 21 or higher
- AndroidX compatibility
- Add the following to your project's build.gradle file:
allprojects {
repositories {
...
maven {
url 'https://maven.pkg.github.com/pagecall/pagecall-android-sdk'
credentials {
username = project.findProperty("GITHUB_USERNAME") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("GITHUB_TOKEN") ?: System.getenv("GITHUB_TOKEN")
}
}
}
}
Github authentication is required, as this SDK is currently uploaded on Github Packages.
The credentials
field is necessary for this purpose. The required permission in this case is read:packages
.
- Add the dependency to your app's build.gradle file:
dependencies {
implementation 'com.pagecall:pagecall-android-sdk:0.0.46' // Recommended to use the latest
}
- Sync your project with the Gradle files.
- In your Android project, import the PagecallWebView class:
import com.pagecall.PagecallWebView;
- Replace your WebView instances with PagecallWebView instances:
PagecallWebView webView = new PagecallWebView(this);
- Please delegate
onActivityResult(...)
to enable file upload functionality:
// MainActivity.java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
webView.onActivityResult(requestCode, resultCode, intent);
}
- Load the Pagecall webapp URL:
// meet mode
webView.load("{room_id}", "{token}", PagecallWebView.PagecallMode.MEET);
// replay mode
webView.load("{room_id}", "{token}", PagecallWebView.PagecallMode.REPLAY);
- Don't forget to add the required permissions in your
AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
The current version of this SDK does not detect when a user denies permissions. Please ensure that permissions are granted before entering a room.
- You can listen to some events (Loaded, Message, Terminated) from PagecallWebView by implementing PagecallWebView. Listener delegate interface and passing to PagecallWebView.setListener(listenerImpl) See MainActivity.java in the sample app.
<com.pagecall.PagecallWebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
For any issues, bug reports, or feature requests, please open an issue in this repository or contact our support team at [email protected].