This repository contains a demo Android application designed to showcase and test the functionalities of the SightCall Vision SDK. The app demonstrates how to effectively integrate the Vision SDK into an Android project.
For detailed documentation and guidance on the SDK, refer to the official SightCall Android SDK documentation.
Before proceeding with the integration, ensure that your project meets the following requirements:
-
Minimum SDK Version:
minSdkVersion 26 -
AndroidManifest Configuration:
If your project includesandroid:allowBackup="false"in the<application>element of yourAndroidManifest.xml, you may need to add the following attribute to avoid conflicts:<application tools:replace="android:allowBackup">
-
Add the Maven repository for SightCall SDK:
maven("https://sightcall-maven.s3.amazonaws.com") -
In your
libs.versions.tomlfile, define the SDK version and dependency configuration:[versions] sightcallSdk = "7.7.1" # Replace with the latest version [libraries] sightcall-sdk = { group = "com.sightcall.universal", name = "universal-sdk", version.ref = "sightcallSdk" } sigthcall-sdf = { group = "com.sightcall.sdf", name = "sdf", version.ref = "sightcallSdk" }
-
Add the dependency to your app-level
build.gradlefile:implementation(libs.sightcall.sdk) implementation(libs.sigthcall.sdf)
If you're not using the Gradle Version Catalog, follow these steps to add the SDK directly:
-
Add the Maven repository for SightCall SDK:
allprojects { repositories { maven { url "https://sightcall-maven.s3.amazonaws.com" } } }
-
Add the dependency to your app-level
build.gradlefile:dependencies { implementation "com.sightcall.universal:universal-sdk:7.6.6" // Replace with the latest version implementation "com.sightcall.sdf:sdf:7.6.6" // Replace with the latest version }'
To properly integrate the SightCall Classic SDK, you must use a Theme.AppCompat or MaterialComponents theme (or one of their descendants) with the relevant activity.
Below is an example of how to define a theme:
<style name="Theme.VisionDemo" parent="Theme.MaterialComponents.Light.NoActionBar" />The Picture-in-Picture (PiP) feature allows a call to remain active in the background while users interact with other applications. This functionality enhances multitasking by providing users the flexibility to continue their video call in a smaller window while performing other tasks.
To enable and support the PiP feature in your app, you must display a notification for the background service handling the call. This notification requires a custom icon that will be shown when PiP mode is activated.
Follow the steps below to configure a custom notification icon for the PiP feature:
-
Create a
launcher.xmlFile
In your project'sres/valuesdirectory, create a file namedlauncher.xml(if it doesn't already exist). -
Define Your Custom Drawable Icon
Inside the newly createdlauncher.xmlfile, add a reference to your custom notification icon. The structure of the file should look like this:<drawable name="universal_icon_notification" tools:override="true"> @drawable/your_icon_name </drawable>
-
Replace the Placeholder with Your Icon Replace
your_icon_namewith the actual name of your custom drawable resource. For example, if your icon is calledicon_notification, the updated code would be:
<drawable name="universal_icon_notification" tools:override="true">
@drawable/icon_notification
</drawable>Start your call using the following code snippet:
val uri = Uri.parse("YOUR_URL_HERE")
SightCall.start(uri)To ensure that users can return to your app after completing the flow, you must initiate the flow in a new task. Add the following to your manifest file:
<activity
android:name="com.sightcall.digitalflow.ui.DigitalFlowActivity"
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
android:taskAffinity="${applicationId}.digitalflow"
android:supportsPictureInPicture="true"
android:exported="true"
android:label="@string/sdf_activity_name"
android:launchMode="singleTask"
android:theme="@style/Theme.SightCall" />The android:taskAffinity attribute specifies the task in which the activity should be launched.
Ensure that your AndroidManifest.xml file includes the necessary permissions for the SightCall SDK according the needed feature.
The demo app's manifest file is already configured with the required permissions.
the full list of permission
```kotlin
<!-- universal sdk permissions -->
<!-- call style notification -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
<!-- full screen call style notification -->
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<!-- screen share -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<!--location permission-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- universal sdk permissions -->