Android SDK Integration
In this guide you will see how to integrate Monlix's offerwall into your Android games or applications.
Integration
- In the top level build.gradle file, add the following
For Gradle < 7
allprojects { repositories { ... maven { url 'https://jitpack.io' } }}For Gradle > 7, in the settings.gradle , add maven with { url 'https://jitpack.io' }
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url 'https://jitpack.io' } }}- In the app level
build.gradlefile, add the dependency
implementation 'com.github.Monlix:android-sdk:v0.3'Usage
1. Load the library in Activity/Fragment
Kotlin
MonlixOffers.Builder() .setAppId("APP_ID") .setUserId("USER_ID") .setAge(20) .setGender(MonlixOffers.Gender.MALE) // MALE, FEMALE, OTHER .setOs(MonlixOffers.OS.ANDROID) // ANDROID, IOS .build(this) // contextJava
new MonlixOffers.Builder() .setAppId("APP_ID") .setUserId("USER_ID") .setAge(20) .setGender(MonlixOffers.Gender.MALE) // MALE, FEMALE, OTHER .setOs(MonlixOffers.OS.ANDROID) // ANDROID, IOS .build(this) // context2. Show the offerwall
Kotlin
MonlixOffers.open(this,"ZONE_ID") // Zone Id is optionalJava
MonlixOffers.INSTANCE.open(this,"ZONE_ID")3. Close the offerwall
Kotlin
MonlixOffers.close(this) // refers to contextJava
MonlixOffers.INSTANCE.close(this)