Installing and configuring the SDK
Integration Guide.
Release version 1.3.6 | Release date 23/04/2024
Minimum requirements:
Use the Android API level 22 (Android OS 5.1) and above.
Demo application
Use our demo application as an example.
Installation
General description of the installation process
To install the Android SDK, you will need:
Check out the demo application
Add
settings.gradle
to your projectComplete the
build.gradle
of your projectSynchronize the
gradle
of the projectCheck the installation correctness by initializing the SDK with debug mode enabled
Prepare the Gradle
Android 11 has changed the way it requests applications and interacts with other applications installed by the user on the device. For this reason, make sure that you are using a version of Cradle that matches one of the ones listed here.
Complete the
settings.gradle
file with the repository necessary for installing the SDK. The full list of repositories will be provided to you by the Madex account manager. Check out your version of Android Studio, and paste the appropriate code intosettings.gradle
at the root of the project. An example of connecting a repository insettings.gradle
.
Complete the
build.gradle
with the necessary build parameters for the correct installation of the SDK.
In the same file, add dependencies to install all the necessary adapters. The full list of dependencies with the current version numbers of libraries and adapters will be provided to you by the Madex account manager. Example of dependencies for Madex, Applovin, Yandex, IronSource and Mintegral networks
Save the file and click
Gradle Sync
.
Code obfuscation
If code obfuscation is enabled in your application, then add the following text to the end of the file proguard-rules.pro
:
Add the Applovin SDK key
If you are using an adapter for Applovin, then add the following <meta-data>
element to your AndroidManifest.xml
inside the <application>
element:
You can copy your APPLOVIN_SDK_KEY
in the "Keys" section of your Applovin personal account.
Installation check
To make sure that the SDK is installed correctly, you will need to enable debug mode and initialize the SDK.
Debug mode
In debug mode SDK logs errors and events. It is disabled by default.
Use the enableDebug
method to enable debug mode.
Initialization
Use the code below to initialize the SDK in your project.
You can copy your publisher_id
in the "Settings" section of your Madex personal account.
If the SDK is installed correctly, you will see the following message in the console.
Done! The SDK is installed, you can proceed to setting up ads.
We recommend that you don't disable debug mode until you finish working with ads.
If the SDK is installed incorrectly
In case of errors, we recommend clearing the Gradle
cache.
If this doesn't help, try installing the SDK in a clean project. If the SDK is installed correctly, try to debug errors in your project.
We also recommend to take a look at the installation and initialization in the demo application.
If you are unable to install the SDK correctly and the above steps didn't lead to successful initialization, please contact support.
Additional actions to increase revenue
Geolocation data collection
To make targeted ads work more effectively and increase revenue, you can collect in app data about a user's exact and/or approximate geolocation, and feed it into the Madex SDK.
Permission to access geolocation is already enabled in the SDK when you install it.
If you don't want to provide the user's geolocation:
Add the following code to your app's
AndroidManifest.xml
:
Update the app on Google Play. During the publishing process, make sure that there are no warnings in the Google Play Console about the availability of location permission without mentioning this in the application's privacy policy and/or without needing it use for app functions.
Other SDK settings
User Consent Screen
In order to comply with the requirements of the app store and the laws governing the collection, processing and use of user's personal data, it is required to obtain his consent to the above actions.
Usually, the user's consent is obtained on a special screen when the application is first launched — consent-screen.
The Madex SDK implements such a screen, you can add and configure it using the Content Manager library.
You can find out more about its installation and configuration in the corresponding section.
pageUser Consent ScreenLast updated