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.
If your app is integrated with HyprMX SDK 6.x and you need help with migrating to 6.4+, please follow the steps in the migration guide.
1. Open your existing application in Android Studio.
2. Add the HyprMX SDK to your app's build.gradle
file dependencies block:
3. Adding Google Play Services Ads Identifier is optional. If the dependency below is included, it is the app developer's responsibility to ensure compliance with all Google Play policies, including, but not limited to, the Families Program.
4. If you are using Kotlin in your application, add the following to your build.gradle
inside the android
block:
Initializing HyprMX
After you have integrated the SDK, proceed to initialize the HyprMX SDK. To initialize, follow the steps below.
1. Add the following imports to your activity, or auto-import them as you move forward with your integration:
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, context and distributorID.
context (required)
Your current context
instance.
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.
If you need to call HyprMx initializer inside a suspending function you can do as below:
Initialization Callbacks
initializationListener
is the listener for the Initialization Status of the SDK. It will callback to onInitialized
as below:
After receiving the onInitialized
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.
You can convert these callbacks to lambda (Java) or use a high-order function on Kotlin, as shown above in the initialization section.
Privacy Compliance
Please refer to our Privacy page to learn more about your privacy compliance responsibilities and to implement the relevant privacy methods.
License
By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.
Last updated