Skip to content

Commit 7f11f09

Browse files
author
Adam Hammer
committed
Update Getting Started
1 parent bda03a7 commit 7f11f09

File tree

1 file changed

+65
-53
lines changed
  • articles/communication-services/quickstarts/ui-library/includes/get-started-call

1 file changed

+65
-53
lines changed

articles/communication-services/quickstarts/ui-library/includes/get-started-call/android.md

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,9 @@ Click `Finish`.
3737

3838
## Install the packages
3939

40-
In your app level (**app folder**) `UILibraryQuickStart/app/build.gradle`, add the following lines to the android and dependencies sections.
40+
### Add Dependency
4141

42-
```groovy
43-
android {
44-
...
45-
packagingOptions {
46-
pickFirst 'META-INF/*'
47-
}
48-
...
49-
}
50-
```
42+
In your app level (**app folder**) `UILibraryQuickStart/app/build.gradle`, add the following dependency.
5143

5244
```groovy
5345
dependencies {
@@ -57,7 +49,12 @@ dependencies {
5749
}
5850
```
5951

60-
In your project gradle scripts add following lines to `repositories`.
52+
### Maven Repositories
53+
54+
Two maven repositories are required to integrate the library. MavenCentral is the first, the second is Azure's package repository.
55+
56+
In your project gradle scripts ensure the following `repositories` are added.
57+
6158
For `Android Studio (2020.*)` the `repositories` are in `settings.gradle` `dependencyResolutionManagement(Gradle version 6.8 or greater)`.
6259
If you are using old versions of `Android Studio (4.*)` then the `repositories` will be in project level `build.gradle` `allprojects{}`.
6360

@@ -72,6 +69,7 @@ repositories {
7269
...
7370
}
7471
```
72+
7573
Sync project with gradle files. (Android Studio -> File -> Sync Project With Gradle Files)
7674

7775
## Add a button to the activity_main
@@ -131,10 +129,11 @@ class MainActivity : AppCompatActivity() {
131129
private fun startCallComposite() {
132130
val communicationTokenRefreshOptions = CommunicationTokenRefreshOptions({ fetchToken() }, true)
133131
val communicationTokenCredential = CommunicationTokenCredential(communicationTokenRefreshOptions)
132+
val locator = CallCompositeGroupCallLocator("GROUP_CALL_ID)
134133
135-
val options = GroupCallOptions(
136-
communicationTokenCredential,
137-
UUID.fromString("GROUP_CALL_ID"),
134+
val options = CallCompositeRemoteOptions(
135+
locator,
136+
communicationTokenCredential,
138137
"DISPLAY_NAME",
139138
)
140139
@@ -183,10 +182,12 @@ public class MainActivity extends AppCompatActivity {
183182
184183
CommunicationTokenCredential communicationTokenCredential =
185184
new CommunicationTokenCredential(communicationTokenRefreshOptions);
185+
186+
CallCompositeGroupCallLocator locator = new CallCompositeGroupCallLocator("GROUP_CALL_ID");
186187
187-
GroupCallOptions options = new GroupCallOptions(
188-
communicationTokenCredential,
189-
UUID.fromString("GROUP_CALL_ID"),
188+
CallCompositeRemoteOptions options = new CallCompositeRemoteOptions(
189+
locator,
190+
communicationTokenCredential,
190191
"DISPLAY_NAME");
191192
192193
CallComposite callComposite = new CallCompositeBuilder().build();
@@ -205,7 +206,7 @@ public class MainActivity extends AppCompatActivity {
205206
Build and start application from Android Studio.
206207
207208
- Click `Launch`.
208-
- Accept audio permissions and select device, mic, and video settings.
209+
- Accept permissions and select device, mic, and video settings.
209210
- Click `Join Call`.
210211
211212
![Launch](../../media/composite-android.gif)
@@ -277,55 +278,60 @@ Depending on what type of Call/Meeting you would like to set up, use the appropr
277278
278279
### Group Call
279280
280-
Initialize a `GroupCallOptions` instance inside the `startCallComposite` function.
281-
Replace `"GROUP_CALL_ID"` with your group ID for your call.
282-
Replace `"DISPLAY_NAME"` with your name.
281+
Initialize a `CallCompositeGroupCallLocator` and supply it to the `CallCompositeRemoteOptions` object.
283282
284283
#### [Kotlin](#tab/kotlin)
285284
286285
```kotlin
287-
val options = GroupCallOptions(
288-
communicationTokenCredential,
289-
UUID.fromString("GROUP_CALL_ID"),
290-
"DISPLAY_NAME",
291-
)
286+
val locator = CallCompositeGroupCallLocator("GROUP_CALL_ID)
287+
288+
val options = CallCompositeRemoteOptions(
289+
locator,
290+
communicationTokenCredential,
291+
"DISPLAY_NAME",
292+
)
292293
```
293294

294295
#### [Java](#tab/java)
295296

296297
```java
297-
GroupCallOptions options = new GroupCallOptions(
298-
communicationTokenCredential,
299-
UUID.fromString("GROUP_CALL_ID"),
300-
"DISPLAY_NAME"
301-
);
298+
CallCompositeGroupCallLocator locator = new CallCompositeGroupCallLocator("GROUP_CALL_ID");
299+
300+
CallCompositeRemoteOptions options = new CallCompositeRemoteOptions(
301+
locator,
302+
communicationTokenCredential,
303+
"DISPLAY_NAME");
302304
```
303305
-----
306+
304307
### Teams Meeting
305308

306-
Initialize a `TeamsMeetingOptions` instance inside the `startCallComposite` function.
307-
Replace `"TEAMS_MEETING_LINK"` with teams meeting url for your call.
308-
Replace `"DISPLAY_NAME"` with your name.
309+
Initialize a `CallCompositeTeamsMeetingLinkLocator` and supply it to the `CallCompositeRemoteOptions` object.
309310

310311
#### [Kotlin](#tab/kotlin)
311312

313+
312314
```kotlin
313-
val options = TeamsMeetingOptions(
314-
communicationTokenCredential,
315-
"TEAMS_MEETING_LINK",
316-
"DISPLAY_NAME",
317-
)
315+
val locator = CallCompositeTeamsMeetingLinkLocator("TEAMS_MEETING_LINK)
316+
317+
val options = CallCompositeRemoteOptions(
318+
locator,
319+
communicationTokenCredential,
320+
"DISPLAY_NAME",
321+
)
318322
```
319323
320324
#### [Java](#tab/java)
321325
322326
```java
323-
TeamsMeetingOptions options = new TeamsMeetingOptions(
324-
communicationTokenCredential,
325-
"TEAMS_MEETING_LINK",
326-
"DISPLAY_NAME"
327-
);
327+
CallCompositeTeamsMeetingLinkLocator locator = new CallCompositeTeamsMeetingLinkLocator("TEAMS_MEETING_LINK");
328+
329+
CallCompositeRemoteOptions options = new CallCompositeRemoteOptions(
330+
locator,
331+
communicationTokenCredential,
332+
"DISPLAY_NAME");
328333
```
334+
-----
329335
330336
-----
331337
### Get a Microsoft Teams meeting link
@@ -354,23 +360,29 @@ callComposite.launch(context, options);
354360
-----
355361
### Subscribe to error events from `CallComposite`
356362
357-
To receive error events, inject a handler to the `CallCompositeBuilder`.
363+
To receive error events register an `onErrorHandler` with the `CallComposite`
364+
365+
This will receiver `CallCompositeErrorEvents` and deliver them to the callback.
366+
367+
The following `errorCode` values may be sent to the Error Handler
368+
369+
- `CallCompositeErrorCode.CALL_JOIN_FAILED`
370+
- `CallCompositeErrorCode.CALL_END_FAILED`
371+
- `CallCompositeErrorCode.TOKEN_EXPIRED`
358372
359373
#### [Kotlin](#tab/kotlin)
360374
361375
```kotlin
362-
val callComposite: CallComposite = CallCompositeBuilder().build()
363-
callComposite.setOnErrorHandler { communicationUIErrorEvent ->
364-
println(communicationUIErrorEvent.errorCode)
376+
callComposite.setOnErrorHandler { callCompositeErrorEvent ->
377+
println(callCompositeErrorEvent.errorCode)
365378
}
366379
```
367380
368381
#### [Java](#tab/java)
369382
370383
```java
371-
CallComposite callComposite = new CallCompositeBuilder().build();
372-
callComposite.setOnErrorHandler(communicationUIErrorEvent -> {
373-
System.out.println(communicationUIErrorEvent.getErrorCode());
384+
callComposite.setOnErrorHandler(callCompositeErrorEvent -> {
385+
System.out.println(callCompositeErrorEvent.getErrorCode());
374386
});
375387
```
376388
@@ -423,7 +435,7 @@ import com.azure.android.communication.ui.calling.models.LocalizationConfigurati
423435
// CommunicationUISupportedLocale provides list of supported locale
424436
val callComposite: CallComposite =
425437
CallCompositeBuilder().localization(
426-
LocalizationConfiguration(Locale(CommunicationUISupportedLocale.EN))
438+
CallCompositeLocalizationConfiguration(Locale(CallCompositeSupportedLocale.EN))
427439
).build()
428440
```
429441
@@ -435,7 +447,7 @@ import com.azure.android.communication.ui.calling.models.LocalizationConfigurati
435447
// CommunicationUISupportedLocale provides list of supported locale
436448
CallComposite callComposite =
437449
new CallCompositeBuilder()
438-
.localization(new LocalizationConfiguration(CommunicationUISupportedLocale.EN))
450+
.localization(new CallCompositeLocalizationConfiguration(CallCompositeSupportedLocale.EN))
439451
.build();
440452
```
441453

0 commit comments

Comments
 (0)