Create Android Adapter
#
Extend Base Adapter ClassCreate a custom adapter class in Java / Kotlin with the naming convention as <AdapterName>SDKAdapter
.
- Kotlin
- Java
#
Initialize the Custom Network SDKOverride one of the initialization methods provided in the base adapter.
#
Asynchronous InitializationinitOnSDKInit()
, method is provided by MesonBaseSDKAdapter
to initialize custom network SDK asynchronously. The method return type is void
.Parameter | Description |
---|---|
AdapterConfiguration | All the network related information required to initialize the custom network SDK. AdapterSDKConfiguration will have atleast one of the required credentials; Network (Account ID), App (App ID) or Ad Line (Placement ID). |
MesonSdkInitializationListener | This listener contains a single call back method onComplete(Error). Listener object should call onComplete() method with the null value if network SDK is initialized successfully or else pass Error object with the proper error message. |
- Kotlin
- Java
#
Synchronous InitializationinitOnAdLoad()
, method is provided by MesonBaseSDKAdapter
to initialize network SDK synchronously. The method return type is not void
; it should return null if network SDK is initialized successfully or else Error object with the proper error message.Parameter | Description |
---|---|
AdapterConfiguration | All the network related information required to initialize the custom network SDK. AdapterSDKConfiguration will have atleast one of the required credentials; Network (Account ID), App (App ID) or Ad Line (Placement ID). |
- Kotlin
- Java
#
Set SDK VersiongetSDKVersion()
, override this method to return custom network SDK version.- Kotlin
- Java
#
Manage Ad LifecycleCreate custom network SDK adapter classes per format with naming convention as AdapterNameFormatAdapter
by extending the base format adapter classes.
#
Banner AdTo create a custom network SDK Adapter class for Banner format extend the MesonBaseBannerAdapter
#
Load Adload()
, override this method in MesonBaseBannerAdapter
to load ad from the custom network SDK.Parameter | Description |
---|---|
AdapterConfiguration | All the network related information required to initialize the custom network SDK. AdapterSDKConfiguration will have atleast one of the required credentials; Network (Account ID), App (App ID) or Ad Line (Placement ID). |
MesonBannerAdapterListener | This provides the ad lifecycle listener events. |
- Kotlin
- Java
#
Return Banner Ad ViewgetAdView()
, override this method in the MesonBaseBannerAdapter
to return custom network SDKs banner ad view.- Kotlin
- Java
#
Release Resourcesinvalidate()
, override this method to release the resources.- Kotlin
- Java
#
Interstitial AdTo create a custom network SDK Adapter class for Interstitial format extend the MesonBaseInterstitialAdapter
#
Load Adload()
, override this method in MesonBaseBannerAdapter
to load ad from the custom network SDK.Parameter | Description |
---|---|
AdapterConfiguration | All the network related information required to initialize the custom network SDK. AdapterSDKConfiguration will have atleast one of the required credentials; Network (Account ID), App (App ID) or Ad Line (Placement ID). |
MesonInterstitialAdapterListener | This provides the ad lifecycle listener events. |
- Kotlin
- Java
#
Ad Load SuccessisReady()
, override this method to verify whether custom network SDK has successfully loaded an ad. This method returns true if custom network SDK is ready to show the ad or else returns false.- Kotlin
- Java
#
Show Adshow()
, override this method to show interstitial or rewarded ad from the custom network SDK.- Kotlin
- Java
#
Release Resourcesinvalidate()
, override this method to release the resources.- Kotlin
- Java
#
Rewarded AdTo create a custom network SDK Adapter class for Rewarded format extend the MesonBaseRewardedAdapter
#
Load Adload()
, override this method in MesonBaseBannerAdapter
to load ad from the custom network SDK.Parameter | Description |
---|---|
AdapterConfiguration | All the network related information required to initialize the custom network SDK. AdapterSDKConfiguration will have atleast one of the required credentials; Network (Account ID), App (App ID) or Ad Line (Placement ID). |
MesonRewardedAdapterListener | This provides the ad lifecycle listener events. |
- Kotlin
- Java
#
Ad Load SuccessisReady()
, override this method to verify whether custom network SDK has successfully loaded an ad. This method returns true if custom network SDK is ready to show the ad or else returns false.- Kotlin
- Java
#
Show Adshow()
, override this method to show interstitial or rewarded ad from the custom network SDK.- Kotlin
- Java
#
Release Resourcesinvalidate()
, override this method to release the resources.- Kotlin
- Java