> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/xamarin/collaboration/setup.md).

# Realtime collaboration setup (Deprecated)

Learn how to set up realtime collaboration with the Apryse SDK for Xamarin.Android. Follow this tutorial for step-by-step instructions on integration and adding the viewer component. Minimum API: 21,

You can setup realtime collaboration functionality using the collaboration package with the Apryse SDK.

## Realtime collaboration setup for Xamarin.Android

{% hint style="info" %}
**This tutorial only applies to Xamarin.Android.**
{% endhint %}

## Prerequisites

* Minimum API: 21
* Java 8

To compile for Java 8, add the following to your application's `.csproj` file:

**Visual Studio 2019 is required**

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
<PropertyGroup>
  <AndroidEnableDesugar>true</AndroidEnableDesugar>
  <AndroidDexTool>d8</AndroidDexTool>
</PropertyGroup>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Step 1: Integration

1. Integrate Apryse core and the tools library as described in [Xamarin get started guide](/xamarin/get-started/xamarin-android/integrate-android.md#integrate-manually).
2. Open the NuGet package manager by right click on your project, and click **Manage NuGet Packages...**. Then in **Browse** tab, search for Apryse.

Insall:

![](https://653871032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgjsBtuYmcKhWOdM9VCg4%2Fuploads%2Fgit-blob-c6eee95070dfb5376fe825ec8b872e156a17dc47%2F6d833e0afcd4d20d5438856f7d436a460851b035-800x75.png?alt=media)

## Step 2: Add the viewer

1. Update your `AndroidManifest.xml` as described in **Step 1** of [this guide](https://docs.apryse.com/xamarin/collaboration/pages/al9b7EBzqCmR4WnZOiAx#step-1:-update-androidmanifestxml).
2. Create the `CollabViewerTabHostFragment2`, and start it like any other Android Fragment.

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
private void addViewerFragment(AppCompatActivity activity, Android.Net.Uri fileUri)
{
    // Create a custom ViewerConfig used to initialize the viewer fragment
    var viewerConfig = new ViewerConfig.Builder()
        .MultiTabEnabled(false)
        .OpenUrlCachePath(this.CacheDir.AbsolutePath)
        .Build();
    // Create the Fragment using CollabViewerBuilder2
    var tabHostFragment = (CollabViewerTabHostFragment2)CollabViewerBuilder2
        .WithUri(fileUri)
        .UsingConfig(viewerConfig)
        .Build(this);
    // Add the Fragment to your activity
    var ft = activity.SupportFragmentManager.BeginTransaction();
    ft.Replace(Resource.Id.fragment_container, tabHostFragment, null);
    ft.Commit();
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

where `R.id.fragment_container` is the resource id of a layout in your activity that will contain your fragment:

**For example:**

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This FrameLayout will contain our viewer fragment -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="match_parent"/>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Next steps

* [Connect with annotation database](/xamarin/collaboration/server.md)
* [Customize collaboration UI](/xamarin/collaboration/client.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/xamarin/collaboration/setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
