---
title: Integration Guide
slug: mobile-sdks/integration-guide
docTags: 
createdAt: 2025-12-14T14:20:34.391Z
---

## Prerequisites

The **ForterSDK** requires initialization from your application's main context. If you haven't set up an Application class yet:

1. Create an [Application class](https://developer.android.com/reference/android/app/Application.html)
2. [Register it in your AndroidManifest.xml](http://stackoverflow.com/questions/2929562/register-application-class-in-manifest)

## Integration Steps

### 1. Initialize the SDK

Add the following initialization code to your Application class's `onCreate()` method:

```java
// Get ForterSDK instance and initiate it with the application context
IForterSDK ftr = ForterSDK.getInstance();
ftr.init(this, AppConstants.FORTER_SITE_ID);
```

:::hint{type="warning"}
You will need to provide a valid Forter site ID (please use the test site ID only for debugging purposes)
:::

:::hint{type="info"}
Advanced configuration of the SDK can be done by initializing the SDK with a customized ForterSDKConfiguration. Please consult with your Forter Implementation Engineer before changing the default configuration.
:::

### 2. Register Activity Lifecycle Callbacks

After initializing the SDK in the `onCreate()` method of your application class, please register our built-in [activity lifecycle callbacks](https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html):

:::hint{type="info"}
This step is only required for SDK versions **below 3.0.0**.
:::

```java
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
	registerActivityLifecycleCallbacks(ftr.getActivityLifecycleCallbacks());
}
```

***

## Complete Integration Example

After performing the above steps, here's how your `onCreate()` method should look:

```java
@Override
public void onCreate() {
    super.onCreate();
    String mobileId = ForterIntegrationUtils.getDeviceUID(this);
    
    // Get ForterClient instance and initiate it
    IForterSDK ftr = ForterSDK.getInstance();
    ftr.init(this,
            AppConstants.FORTER_SITE_ID // your unique Forter site ID
    );
    
    // Start generic activity-based navigation tracking (ForterSDK < 3.0.0)
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        registerActivityLifecycleCallbacks(ftr.getActivityLifecycleCallbacks());
    }
}
```
