DEV Community

Cover image for Microsoft Teams Video Calls to .NET MAUI: A Seamless Integration Guide for Android
Sr. Kuantico
Sr. Kuantico

Posted on

Microsoft Teams Video Calls to .NET MAUI: A Seamless Integration Guide for Android

Ever wished you could blend .NET MAUI with the collaboration magic of Microsoft Teams? With .NET MAUI, building native apps for multiple platforms is easier than ever β€” and now, you can take it a step further by integrating a new Azure UI Library that get you directly with Teams video calls! making your apps more collaborative and accessible with the power of Azure + Teams. πŸš€

Not too many .NET MAUI Frameworks for video calls

One noticeable gap in .NET MAUI right now is the lack of built-in support for implementing video calls. While MAUI excels at creating cross-platform applications with a single codebase, developers looking to integrate real-time video communication need to rely on third-party SDKs or platform-specific implementations. Unlike some frameworks that offer native modules for video conferencing, .NET MAUI doesn't currently provide an out-of-the-box solution, which can add complexity when targeting multiple platforms like Android, iOS, Windows, and macOS. This means handling platform-specific quirks and ensuring smooth video performance across devices, often leading to additional development overhead.

Azure Communication Service UI Library for Mobile

Even with the market being blooding by the lack of options The Azure team has designed this new library as a solution. This required a platform-specific implementation, but today we will just focus on Android.

The Azure Communication UI Mobile Library gives you plug-and-play UI components for building B2C and B2B calling experiences fastβ€”no need to start from scratch. Now let's start the coding...

Prerequisites

Based on Contributors Documentation take this requirements as must:

After having done all preparation points, let's start with the implementation.

Getting Start

1- Open the repo downloaded call: CommunicationCallingSampleMauiApp with your file explorer/finder.

2- Now, create your own .NET MAUI project. In my case, I created one based on .NET 9 just for Android.

KCode

3- From the repo project downloaded, find this folder AndroidMauiBindings and copy the files from the image into your solution folder:

KCode

4- Run the script file with your Gitbash (Windows) console or your preference editor, like this:

KCode

///First command
chmod +x downloadJarScript.sh
///Second command
./downloadJarScript.sh
Enter fullscreen mode Exit fullscreen mode

5- Import the android bindings previously copied under your solution:

KCode

KCode

KCode

This binding are very important and their Jars libreries too. If you can get it correctly from the repo, try it from the original source.

6- After that, add the resources folder require for bindings to get the necessary assets to drawing the Video Call UI:

KCode

KCode

7- Now go to your Android Manifest file and make sure it looks like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <application
    android:allowBackup="true"
    tools:replace="android:label"
    android:icon="@mipmap/appicon"
    android:roundIcon="@mipmap/appicon_round"
    android:supportsRtl="true"
    android:enableOnBackInvokedCallback="true"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>
Enter fullscreen mode Exit fullscreen mode

8- Now is time to compile your project and everything should be good.

KCode

9- I submitted a repo with this working, and you can find the missed pieces in there.

10- Considered to add in your Azure Portal the necessary resources to make this work. For this one we will need an Azure Communication Service. First create the resource and finally, generate the token.

11- Finally, the place to put your token and meeting info, you will find it on MainPage.xaml.cs:

private void OnCounterClicked(object sender, EventArgs e)
        {
             callComposite.joinCall("[Your Name]", "[Place your token in here]", "[Place your Teams link meeting in here]", CallType.TeamsCall, _localization, _dataModelInjection, _orientationProps, _callControlProps);
        }
Enter fullscreen mode Exit fullscreen mode

NOTES TO CONSIDERE

NOTE #1: There is a reported about this kind of implementation saved on a very long file path. Consider to save this in a shorter place, As: C:/src/[MyProject]. Issue Link.

NOTE #2: Make sure to setup the project file as was recommended other wise, you could get this type of Issue.

Top comments (0)