> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Android

> Configure Android build settings and add required dependencies for the MoEngage React Native SDK.

# Configuring Build Settings

## Add Androidx Libraries

<Info>
  The MoEngage SDK depends on the lifecycle-process library for a few key features to work, and the latest version of lifecycle-process depends on the androidx.startup:startup-runtime library. Hence, do not remove the InitializationProvider component from the manifest. When adding other Initializers using the startup-runtime, make sure the Initializer for the lifecycle-process library is also added. Refer to the [documentation](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.4.0) to know how to add the Initializer
</Info>

The SDK also depends on a few Androidx libraries for its functioning. Add the below Androidx libraries in your application's ***build.gradle*** file or enable the required flag in the Package JSON file.

### Configure in the Package JSON file

<Info>
  * Setting the includeAndroidXRequiredLibraries to `true` automatically adds the AndroidX libraries that are used by the SDK as a dependency.
  * **Required AndroidX Libraries:** The MoEngage SDK requires the following core AndroidX dependencies:
    * `androidx.core:core`
    * `androidx.appcompat:appcompat`
    * `androidx.lifecycle:lifecycle-process`
  * Before enabling this flag, validate if your application's native Android project (`build.gradle`) already has compatible versions of these libraries installed. If your app already includes them, you may not need to pull them in again, which helps prevent version conflicts or duplicate dependency errors during the build process.
</Info>

File - ***package.json***

<CodeGroup>
  ```json JSON theme={null}
  {
      "moengage": {
          "includeAndroidXRequiredLibraries": true
      }
  }
  ```
</CodeGroup>

### Configure in the Gradle file

Skip this step if ***includeAndroidXRequiredLibraries***flag is enabled in previous step.

Path - ***android/app/build.gradle(.kts)***

<CodeGroup>
  ```Groovy Groovy theme={null}

      dependencies {
      ...
        implementation("androidx.core:core:1.9.0")
        implementation("androidx.appcompat:appcompat:1.4.2")
        implementation("androidx.lifecycle:lifecycle-process:2.7.0")
      }
  ```
</CodeGroup>

## Feature Modules (optional)

To include optional modules from the MoEngage SDK based on your feature requirements, you can use the provided flags. By default, these modules are not included in your project.

You can configure this by adding a new "moengage" key to the root level of your project's package.json file.

Inside this object, you can pass specific feature flags:

* true: Instructs the build system to download and link the required native dependencies for that specific module.
* false (or omitting the key): Excludes the module from your project. By default, all optional modules are excluded to help keep your overall app size optimized.

File - ***package.json***

<CodeGroup>
  ```json JSON theme={null}
  {
      "moengage": {
          "richNotification": true,
          //Required for Push Templates
         
          "encryption": true,
         //Required for Add-On-Security
        
          "pushAmp": true,
          //Required for Push Amplification
        
          "hmsPushkit": true,
          //Required for HMS PushKit
        
          "deviceTrigger": true
         //Required for Device Triggered
      }
  }
  ```
</CodeGroup>

### Documentation For Optional Feature Flag

* [Push Templates](/developer-guide/android-sdk/push/optional/push-templates)
* [Add-On-Security](/developer-guide/android-sdk/sdk-integration/advanced-or-optional/add-on-security)
* [Push Amplification](/developer-guide/android-sdk/push/optional/push-amplification)
* [HMS PushKit](/developer-guide/android-sdk/push/optional/push-amp-plus/configuring-hms-push-kit)
* [Device Triggered](/developer-guide/android-sdk/push/optional/device-triggered)
