Android / Amazon Setup Guide

The HyprMX SDK is designed to present rewarded, interstitial, and banner/MREC ads in your application. To integrate the SDK, follow the steps below.

SDK Integration

You can integrate the HyprMX SDK through Gradle dependencies. Follow the steps below to set up the SDK.

This guide assumes you already have your Gradle-based project up and running in Android Studio.

1. Open your existing application in Android Studio.

2. Add the HyprMX SDK to your app's build.gradle file dependencies block:

dependencies {
    implementation ''

3. Adding Google Play Services Ads Identifier is optional. If the dependency below is included, it is the responsibility of the app developer to ensure compliance with all Google Play policies, including, and not limited to, Families Program.

dependencies {
	implementation ''

4. If you are using Kotlin in your application, add the following to your build.gradle inside the android block:

kotlinOptions {
  jvmTarget = "1.8"
  freeCompilerArgs = [

Initializing HyprMX

After you have integrated the SDK, proceed to initializing the HyprMX SDK. To initialize, follow the steps below.

1. Add the following imports to your activity:


2. Initialize the HyprMX SDK in your main Activity inside the onCreate method as shown below. As a best practice, initialize HyprMX as soon as possible (i.e. when your application is loading) so we can begin preloading ads. Review the details of initialization parameters (distributorID, userID, consentStatus, and ageRestrictedUser) below to find out what initializer best suits your app's use case.

Sample Initializer

String distributorID = "Your Distributor ID";
String userID = "Your User's ID";
ConsentStatus consentStatus = ConsentStatus.CONSENT_STATUS_UNKNOWN; // If you don't have consent status for the user, set this to CONSENT_STATUS_UNKNOWN
HyprMXIf.HyprMXInitializationListener initializationListener;
boolean ageRestrictedUser = true; // Set this to true if the user is under 16
// Use this initializer if your app's target audience includes children.
HyprMX.INSTANCE.initialize(this, distributorID, userID, consentStatus, ageRestrictedUser, initializationListener);

distributorID (required)

The value for distributorID is assigned to your app by HyprMX. If you have not received this ID and your placements information, please reach out to your HyprMX account manager.

userID (required)

The userID is a unique identifier supplied by your application and must be static for each user across sessions. Your userID should not contain any personally identifiable information such as an email address, screen name, Android Device ID (AID), or Google Advertising ID/Android Advertising ID (GAID/AAID). If you don’t already have a static user identifier, you can use the code below to generate one.

private String getUserId() {
  SharedPreferences sharedPreferences = getSharedPreferences("hyprmx_prefs", Context.MODE_PRIVATE);
  String userID = sharedPreferences.getString("hyprUserId", null);
  if (userID == null) {
    userID = UUID.randomUUID().toString();
    sharedPreferences.edit().putString("hyprUserId", userID).apply();
  return userID;

consentStatus (optional)

HyprMX provides an Initialization API with a consentStatus parameter with below values for jurisdictions that require passing consent that takes a ConsentStatus value depending on the user consent collected by your app. Refer to our privacy page for more information on consent flag.




HyprMX also provides a separate method for setting Consent. Use this when a user's consent status changes:


ageRestrictedUser (optional)

HyprMX provides an Initialization API with an ageRestrictedUser parameter. If the user requires child-directed treatment under applicable laws and policies, set this parameter to true. Otherwise, set it to false. For additional guidelines around this flag, please refer to our privacy page.

Initialization Callbacks

initializationListener is the listener for Initialization Status of the SDK. It will callback to initializationComplete or initializationFailed as below:

HyprMXIf.HyprMXInitializationListener initializationListener = new HyprMXIf.HyprMXInitializationListener() {
  public void initializationComplete() {}

  public void initializationFailed() {}

After receiving the initializationDidComplete callback, you are now ready to load and display ads in your application. See our Rewarded Ads, Interstitial Ads, and Banner/MREC Ads guides to add these ad types to your app.


By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.

Last updated