Share via

Quickstart: Join your chat app to a Teams meeting

For full instructions on how to build this code sample from scratch, look at Quickstart: Join your chat app to a Teams meeting

Prerequisites

To complete this tutorial, you’ll need the following prerequisites:

Code Structure

  • ./app/src/main/java/com/contoso/acsquickstart/MainActivity.java: Contains core logic for calling SDK integration.
  • ./app/src/main/res/layout/activity_main.xml: Contains core UI for sample app.

Object model

The following classes and interfaces used in the quickstart handle some of the major features of the Azure Communication Services Calling client library:

Name Description
CallClient The CallClient is the main entry point to the Calling client library.
CallAgent The CallAgent is used to start and manage calls.
ChatThreadAsyncClient The ChatThreadAsyncClient is the main entry point to the Chat client library.
CommunicationTokenCredential The CommunicationTokenCredential is used as the token credential to instantiate the CallAgent.

Before running sample code

  1. Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you'd like to clone the sample to.
  2. git clone https://github.com/Azure-Samples/Communication-Services-Android-Quickstarts.git
  3. With the User Token procured in pre-requisites, add it to the ./app/src/main/java/com/contoso/acsquickstart/MainActivity.java file. Assign your access token in line 51: private static final String UserToken = "<User_Access_Token>";
  4. Add the created user ID in line 54: private static final String InitiatorId = "<USER_ID>";
  5. Add the communications service endpoint URL at line 55: private static final String ResourceUrl = "<COMMUNICATION_SERVICES_RESOURCE_ENDPOINT>";

Run the sample

Open the sample project using Android Studio and run the application.

Final look and feel of the quick start app

Insert the Teams meeting URL into the text box, the chat thread ID into the Meeting Thread Id text box, and press Join Meeting to join the Teams meeting from within your Communication Services application.

The Teams meeting link can be retrieved using Graph APIs. This is detailed in Graph documentation. The Communication Services Calling SDK accepts a full Teams meeting link. This link is returned as part of the onlineMeeting resource, accessible under the joinWebUrl property.

Get the chat thread ID

With the Graph APIs, you can also obtain the threadID. The response has a chatInfo object that contains the threadID.