# Using in Native Android Projects (UaaL)

### Complete Setup

1. Open Unity Player Settings
2. Go to Publishing Settings
3. Enable Main Gradle Template
4. Enable Main Android Manifest  and open from Assets/Plugins/Android folder
5. Add service tag (between existing \<application> \</application> tag as stated in [#file-setup-androidmanifest.xml](#file-setup-androidmanifest.xml "mention")
6. Open settings.gradle of your root native project and add lines from[#file-setup-settings.gradle](#file-setup-settings.gradle "mention") at the end of the file after you include unityLibrary project directory.

***

### External Dependency Manager Setup (Optional)

1. Open Assets -> External Dependency Manager -> Android -> Settings
2. Open Assets -> External Dependency Manager -> Android -> Force Resolve

### File Setup : AndroidManifest.xml

{% code overflow="wrap" %}

```
<service android:name="com.voxelbusters.screenrecorderkit.videorecorder.internal.ScreenRecordingService" android:enabled="true" android:process=":UnityPlayer" android:foregroundServiceType="mediaProjection" />
```

{% endcode %}

{% hint style="success" %}
Setting up the Android Manifest is a must as Unity runs in a different process (UnityPlayer) so for recording service to work we need to set this attribute
{% endhint %}

{% hint style="info" %}
Note that the process name could be different for your project. You can get the value from the main launcher android manifest xml file. If you don't run unity in a separate process, you can just skip adding android:process attribute.
{% endhint %}

### File Setup : settings.gradle

```gradle
include 'unityLibrary:com.voxelbusters.screenrecorderkit.androidlib'
```

> After the above steps, follow [this document](https://forum.unity.com/threads/integration-unity-as-a-library-in-native-android-app-version-2.751712/) on actions for Android Studio.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://assetstore.replaykit.voxelbusters.com/misc/using-in-native-android-projects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
