diff --git a/README.md b/README.md index 9c0bdd4..56f63ea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Voximplant Kotlin Demos -## [Audio Call with ConnectionService](audiocall) -This demo demonstrates audio call of the Voximplant Android SDK with ConnectionService integration. +## [Audio Call](audiocall) +This demo demonstrates audio call of the Voximplant Android SDK with/without [ConnectionService](audiocall/ConnectionService.MD) integration. ## [Video Call](videocall) The demo demonstrates basic video call functionality of the Voximplant Android SDK. diff --git a/audiocall/ConnectionService.MD b/audiocall/ConnectionService.MD index 6098cdc..7144f08 100644 --- a/audiocall/ConnectionService.MD +++ b/audiocall/ConnectionService.MD @@ -3,6 +3,12 @@ This article provides a step-by-step tutorial to integrate a self-managed `Conne A self-managed `ConnectionService` resolves the situation of multiple calls from various applications that also use the ConnectionService API, such as switching between calls on hold or answering an incoming call when you're already on a call. It also allows answering or declining calls on wearable devices. +## Check system feature availability +A self-managed `ConnectionService` can only be used if the system has the `FEATURE_TELECOM` or `FEATURE_CONNECTION_SERVICE` features. +Otherwise, the system throws an exception on any TelecomManager API call. + +System features can be checked via [PackageManager.hasSystemFeature](https://developer.android.com/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String)). + ## Manifest declarations and permissions To integrate a self-managed `ConnectionService`, declare the `MANAGE_OWN_CALLS` permission in the AndroidManifest.xml file. ```XML @@ -87,7 +93,7 @@ The Voximplant Android SDK provides the following capabilities for an ongoing ca Mute and audio device changing capabilities are fully managed by the Voximplant Android SDK and do not require any `Connection` API call. -However, to put the call on hold, the application `Connection` state should be changed via the `Connection.setOnHold()` API. Please be sure to change the `Connection` state only if `ICall.hold()` is completed successfully. +However, to put the call on hold, the application `Connection` state should be changed via the `Connection.setOnHold()` API. Please be sure to change the `Connection` state only if `ICall.hold()` is completed successfully. ```Kotlin call?.hold(hold, object : ICallCompletionHandler { @@ -110,9 +116,9 @@ Please note: ### End ongoing call -Either a user or a remote party can end an ongoing call. +Either a user or a remote party can end an ongoing call. -If the user ends the call, the application should call `ICall.hangup()` API, so the Voximplant Android SDK triggers the `ICallListener.onCallDisconnected()` event. +If the user ends the call, the application should call `ICall.hangup()` API, so the Voximplant Android SDK triggers the `ICallListener.onCallDisconnected()` event. If the remote party ends the call, the Voximplant Android SDK informs the application by triggering the `ICallListener.onCallDisconnected()` event. diff --git a/audiocall/README.MD b/audiocall/README.MD index c7022d6..11e7093 100644 --- a/audiocall/README.MD +++ b/audiocall/README.MD @@ -1,13 +1,17 @@ # Voximplant Audio Call Demo with ConnectionService integration -This demo demonstrates audio call of the Voximplant Android SDK with ConnectionService integration. The application supports audio calls between this Android app and other apps that use any Voximplant SDK. +This demo demonstrates audio call of the Voximplant Android SDK with/without [ConnectionService](ConnectionService.MD) integration. +The application supports audio calls between the current Android app and other apps that use any Voximplant SDK. +It uses two ways to control calls: +- Default (`AudioCallManagerDefault`) +- Integration with self-managed ConnectionService (`AudioCallManagerTelecom`) -Based on MVVM architectural pattern. +The choice of implementation depends on the device's Android version and the `FEATURE_TELECOM` or `FEATURE_CONNECTION_SERVICE` availability in the system. -`ConnectionService` is an abstract service that could be implemented by any apps which either: +`ConnectionService` is an abstract service that could be implemented by any apps which either: 1. Can make phone calls (VoIP or otherwise) and want those calls to be integrated into the built-in phone app. Referred to as a system managed `ConnectionService`. -2. Are a standalone calling app and don't want their calls to be integrated into the built-in phone app. Referred to as a self managed `ConnectionService`. -`ConnectionService` requires Android API level 23 according to the [official Android documentation](https://developer.android.com/reference/android/telecom/ConnectionService), but this app uses `Connection.PROPERTY_SELF_MANAGED` which requires API level 26. +2. Are a standalone calling app and don't want their calls to be integrated into the built-in phone app. Referred to as a self-managed `ConnectionService`. + `ConnectionService` requires Android API level 23 according to the [official Android documentation](https://developer.android.com/reference/android/telecom/ConnectionService), but this app uses `Connection.PROPERTY_SELF_MANAGED` which requires API level 26. ## Features The application is able to: