---
updatedAt: 2026-06-12T13:28:12.000Z
agentTools:
  projectIndex: https://docs.webengage.com/llms.txt
---

# Xamarin.Android

[Xamarin.Android](https://docs.microsoft.com/en-us/xamarin/android/) exposes the complete Android SDK for .NET developers. It enables you to build fully native Android apps using C# or F#.

**Here's how you can integrate the WebEngage SDK with your Xamarin.Android app:**

# Prerequisites

## 1. Identify your region

Your data is stored in a specific Data Center based on your account location. You must define this region for the SDK to initialize successfully.

| Dashboard Host URL          | Region                         | SDK Config value (Region specifc) |
| :-------------------------- | :----------------------------- | :-------------------------------- |
| dashboard.webengage.com     | Global Data Center (US)        | US                                |
| dashboard.in.webengage.com  | India Data Center (IN)         | IN                                |
| dashboard.ksa.webengage.com | Saudi Arabia Data Center (KSA) | KSA                               |
| dashboard.eug.webengage.com | Europe Frankfurt (EUG)         | EUG                               |

<Callout icon="🚧" theme="warn">
  **Note**: Depending on your host URL above, you will use the corresponding SDK config value: .US, .IN, or .KSA, .EUG
</Callout>

## 2. Locate your WebEngage License Code

1. Log in to your **WebEngage Dashboard**.
2. Navigate to **Settings → Project**.
3. Copy your **License Code** (e.g., `abcd1234`).
   <Image alt={1440} caption="Finding your WebEngage License Code" title="account-license-code.png" src="https://files.readme.io/1fe9211-account-license-code.png" />

***

**Step 1:**  Download [WebEngage Xamarin.Android Library](https://s3-us-west-2.amazonaws.com/webengage-sdk/xamarin/android/0.4.0.0/WebEngageXamarinAndroid.dll).

**Step 2:** To consume this downloaded .DLL in your Xamarin.Android app, you must add a reference to the Bindings Library. To do this, right-click on the **References** node of your project and select **Add Reference**.

## 2. Initialization

Initialize WebEngage SDK with your license code from `onCreate` callback of your Application class as shown below.

```csharp
using Com.Webengage.Sdk.Android;
...

	[Application]
    public class YourApplication : Application
    {
    	...

    	public override void OnCreate()
        {
            base.OnCreate();

            WebEngageConfig config = new WebEngageConfig.Builder()
                                                        .SetWebEngageKey(YOUR_WEBENGAGE_LICENSE_CODE)
                                                        .SetDebugMode(true)
                                                        .Build();
            RegisterActivityLifecycleCallbacks(new WebEngageActivityLifeCycleCallbacks(this, config));

            ...
        }
    }
```

**Make sure you replace`YOUR_WEBENGAGE_LICENSE_CODE` with your WebEngage license code**

**Add`meta-data` under in the `AndroidManifest.xml` file**

Thus, depending on your data center, add the appropriate `meta-data` under the `application` tag of your `AndroidManifest.xml` file:

| Data Center       | Meta Data Tag                                                                            |
| :---------------- | :--------------------------------------------------------------------------------------- |
| Global (US)       | `<meta-data android:name="com.webengage.sdk.android.environment" android:value="us" />`  |
| India             | `<meta-data android:name="com.webengage.sdk.android.environment" android:value="in" />`  |
| Saudi Arabia      | `<meta-data android:name="com.webengage.sdk.android.environment" android:value="ksa" />` |
| Europe (Franfurt) | `<meta-data android:name="com.webengage.sdk.android.environment" android:value="eug" />` |

## 3. Attribution Tracking

**Step 1:** Make sure that you are using WebEngage Xamarin Android Library version 0.4.0.0 or above.

**Step 2:** Download the latest version of [Android Install Referrer library](https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer).

**Step 3:** Add the aar file to your Xamarin.Android project, for example at location `YourProject/lib/installreferrer-1.1.1.aar`.

**Step 4:** Set Build Action for the installreferrer aar to AndroidAarLibrary.

> 🚧 Please note
>
> `App Installed` event and `First Acquisition Details` data in user profile will not be tracked on your Android app unless you follow the above step.

## 4. Additional Steps (Optional)

For other integrations such as [location tracking](xamarin-android-advanced#section-location-tracking), please refer to the *[Advanced section](xamarin-android-advanced)*.

> 🚧 Congratulations!
>
> You have successfully integrated WebEngage with your Hybrid app and are sending user session data to WebEngage. Please note that it may take a few minutes for data to reflect in your dashboard.

Please feel free to drop in a few lines at *<support@webengage.com>* in case you have any further queries. We're always just an email away!