public abstract class

AppLovinSdk

extends Object
java.lang.Object
   ↳ com.applovin.sdk.AppLovinSdk

Class Overview

This is a base class for AppLovin Ad SDK.

Summary

Constants
String CIS_BUILD_TAG
String VERSION Current SDK version
int VERSION_CODE
Public Constructors
AppLovinSdk()
Please use AppLovinSdk.getInstance(Context context) rather than instantiating this class directly.
Public Methods
abstract AppLovinAdService getAdService()
Get an instance of the AppLovin Ad service.
abstract AppLovinEventService getEventService()
Get an instance of the AppLovin event service.
static AppLovinSdk getInstance(Context context)
Get instance of AppLovin SDK that is configured in AndroidManifest.xml.
static AppLovinSdk getInstance(String sdkKey, AppLovinSdkSettings userSettings, Context context)
Get an instance of AppLovin SDK.
static AppLovinSdk getInstance(AppLovinSdkSettings settings, Context context)
Get instance of AppLovin SDK that is configured in AndroidManifest.xml.
abstract AppLovinNativeAdService getNativeAdService()
Get an instance of the AppLovin native ad service.
abstract AppLovinPostbackService getPostbackService()
Get an instance of the AppLovin postback service.
abstract AppLovinSdkSettings getSettings()
Get SDK settings provided on initialization
abstract AppLovinTargetingData getTargetingData()
Get an instance of AppLovin Targeting data.
abstract boolean hasCriticalErrors()
Check if SDK has a critical error prior to initialization.
static void initializeSdk(Context context)
Intialize the default version of the SDK.
abstract void initializeSdk()
Initialize current version of the SDK
abstract boolean isEnabled()
Check if SDK is enabled.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CIS_BUILD_TAG

Constant Value: "{BUILD_NUMBER}"

public static final String VERSION

Current SDK version

Constant Value: "6.1.5"

public static final int VERSION_CODE

Constant Value: 615 (0x00000267)

Public Constructors

public AppLovinSdk ()

Please use AppLovinSdk.getInstance(Context context) rather than instantiating this class directly.

Public Methods

public abstract AppLovinAdService getAdService ()

Get an instance of the AppLovin Ad service. This service is used to fetch ads from AppLovin servers, track clicks and conversions.

Returns
  • Ad service. Guaranteed not to be null.

public abstract AppLovinEventService getEventService ()

Get an instance of the AppLovin event service. This service is used to track post-install user events.

Returns
  • Event service. Guaranteed not to be null.

public static AppLovinSdk getInstance (Context context)

Get instance of AppLovin SDK that is configured in AndroidManifest.xml. Please make sure that AndroidManifest.xml includes following line:

     <application>
                     . . .
         <meta-data android:value="YOUR_SDK_KEY_HERE" android:name="APPLOVIN_SDK_KEY" />
     </application>
 

Parameters
context Android application context. Must not be null.
Returns
  • An instance of AppLovinSDK

public static AppLovinSdk getInstance (String sdkKey, AppLovinSdkSettings userSettings, Context context)

Get an instance of AppLovin SDK.

Parameters
sdkKey Client SDK's key.
userSettings User-provided settings. May be null.
context Android context. Must not be null. Note that a reference to context.getApplicationContext() will be persisted by the API.
Returns
  • An instance of AppLovinSDK

public static AppLovinSdk getInstance (AppLovinSdkSettings settings, Context context)

Get instance of AppLovin SDK that is configured in AndroidManifest.xml. Please make sure that AndroidManifest.xml includes following line:

     <application>
                     . . .
         <meta-data android:value="YOUR_SDK_KEY_HERE" android:name="APPLOVIN_SDK_KEY" />
     </application>
 

Parameters
settings Settings to use with an SDK. Must not be null.
context Android application context. Must not be null.
Returns
  • An instance of AppLovinSDK

public abstract AppLovinNativeAdService getNativeAdService ()

Get an instance of the AppLovin native ad service. This service is used to fetch in-content ads from AppLovin servers, track clicks and conversions.

Returns
  • Ad service. Guaranteed not to be null.

public abstract AppLovinPostbackService getPostbackService ()

Get an instance of the AppLovin postback service. This service is used to dispatch HTTP GET postbacks to arbitrary URLs.

Returns
  • Postback service. Guaranteed not to be null.

public abstract AppLovinSdkSettings getSettings ()

Get SDK settings provided on initialization

Returns
  • Provided settings.

public abstract AppLovinTargetingData getTargetingData ()

Get an instance of AppLovin Targeting data. This object contains targeting values that could be provided to AppLovin for better advertisement performance.

Returns
  • Current targeting data. Guaranteed not to be null.

public abstract boolean hasCriticalErrors ()

Check if SDK has a critical error prior to initialization. Critical errors could occur when SDK is ran on a device with API level lower then 8.

Returns
  • True if API is disabled because of a critical error.

public static void initializeSdk (Context context)

Intialize the default version of the SDK. Please make sure that AndroidManifest.xml includes following line:

     <application>
                     . . .
         <meta-data android:value="YOUR_SDK_KEY_HERE" android:name="APPLOVIN_SDK_KEY" />
     </application>
 

Parameters
context Android application context. Must not be null.

public abstract void initializeSdk ()

Initialize current version of the SDK

public abstract boolean isEnabled ()

Check if SDK is enabled. SDK is enabled when (1) client successfully registered with the AppLovin server and (2) client is not banned from the server.

Returns
  • True if API is ready to be used.