4.1 Admob Adapter
Note: Due to internal logic limitations of the Google Ads SDK, offline scenario traffic cannot be forwarded to the Hisavana SDK via the adapter. If you wish to use Hisavana's offline capabilities, it is recommended that you integrate the Hisavana SDK directly.
4.1.1 Version Release History
| Version | Release Date | Updates |
|---|---|---|
| 3.1.9.1 | 2025-03-10 | Depends on Hisavana SDK version 3.1.9.1; Upgraded google play-services-ads version to 22.0.0 |
| 2.2.0.2 | 2023-02-24 | Fixed the issue of no click callback for native ads |
| 2.0.1.2 | 2022-09-02 | Initial version release |
4.1.2 Adding Custom Events in the AdMob UI.
On the homepage, click the left sidebar - Mediation, select 'Add Mediation Group' in the middle, and follow the prompts to proceed with subsequent operations.

On the Add Mediation Group interface - under the Ad Sources - Waterfall path, click Add Custom Event.

Add Ad Unit Mapping

Class Name:
Version 3.1.9.1 and later: com.hisavana.admob.adapter.HisavanaAdapter
Versions before 3.1.9.1: com.hisavana.admob.adapter.SampleAdapter
Parameter:
Enter the Ad Unit ID applied for in the Hisavana backend.
4.1.3 Importing the Adapter SDK into the Project
First, add the maven remote repository URL to the project-level build.gradle file, as shown below:
buildscript {
repositories {
maven { url "https://mvn.shalltry.com/repository/maven-public/" }
maven { url "https://mvn.shalltry.com/repository/ad-releases/" }
}
}
allprojects {
repositories {
maven { url "https://mvn.shalltry.com/repository/maven-public/" }
maven { url "https://mvn.shalltry.com/repository/ad-releases/" }
}
}
Then, introduce the admob adapter package in the Module's build.gradle:
implementation "com.cloud.hisavana.sdk.ssp.adapter:admob:3.1.9.1"
implementation "com.google.android.gms:play-services-ads:22.0.0"
4.1.4 SDK Initialization Configuration
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Hisavana Adapter initialization. Constants.hisavanaAppId is the AppId applied for in the Hisavana backend
HisavanaManager.setAppId(Constants.hisavanaAppId);
// Google Ads Initialization
MobileAds.initialize(this.getApplicationContext(), initializationStatus -> {
Log.d("MobileAds", "Init status: " + initializationStatus.toString());
});
}
}
4.1.5 Using Google Ads API to Request Ads
(Omitted)