👨🏼💻How to Integrate Huawei Ads Adapter of OpenMediation to a Native Android Project
Introduction
Hello everyone,
In this article we will talk about how to perform ad mediation using Android SDK and Huawei Ads adapter of OpenMediation.
Before moving on to the integration steps, let’s take a look at the concept of “Mediation” and OpenMediation platform.
What is ad meditation?
Ad Mediation gives multiple ad networks access to your ad inventory, and gets them to compete against each other for ad slots. This process increases competition among advertisers and in return, increases your ad revenue. The mediation platform checks what CPM all the various ad networks are offering and looks for the highest one.
OpenMediation
OpenMediation is a third party platform for mobile App developers focusing on user lifecycle management and enabling them to monetize the App. In other word, OpenMediation is a fully open mediation platform, providing an end-to-end system from SDK to server, Dashboard, and datacentre.
Currently, OpenMediation supports following ad formats:
- Banner
- Native
- Interstitial
- Rewarded
Integration Process of Huawei Ads Adapter of OpenMediation
Now, we can start to talk about the integration process of Huawei Ads and OpenMediation SDK through mediation. This process includes 3 parts :
- Configurations on Huawei Ads Console
- Configurations on OpenMediation Dashboard
- Development Process on Source Code
1. Configurations on Huawei Ads Console
In Huawei Ads platform, all we need to do is creating ad units of ad formats we want to use and keeping the ad unit IDs to use for next operations.
For details about creating ad unit in Huawei Ads Platform you can refer to this link.
2.Configurations on OpenMediation Dashboard
We need to register on OpenMediation platform in order to access Dashboard. You can create an account with using this link.
After registration process, we will follow the steps below:
- Creating App in OpenMediation Console
- Adding and Managing Ad Placement
- Configuration of Ad Instance for Ad Placement
- Setting Mediation Rule
Creating App in OpenMediation Console
Log in to OpenMediation Dashboard and navigate to the Overview interface. You will see Add App at the top of the application list, click to start adding an APP.
First, select your app’s platform and indicate if your App is listed in a supported app store.
If your app is listed in the store, please find your app on the selected Store.
For details about creating app in OpenMediation Dashboard please refer to Adding apps document in Open Mediation Help Center.
Adding and Managing Ad Placement
The placement needs to match the added application, and you need to select the corresponding app in the application list of Overview. After entering Monetize, click Setup, click placement in the navigation bar, and click Add Placement to add placement
After customizing the name of the placement in the Name column, select the ad type you want and click Save on the top of the page.
In the Operations section, you can control the status of each placements, Enable or Disable
Note :
Only one rewarded and interstitial placement is allowed to be created in the OpenMediation platform. Multi-ad scene requirements can be implemented by automatically calling logic and scene functions through the OpenMediation SDK.So, after perfom the adding placement steps for Rewarded and Interstitial Ads, you can also add Placement Scenes for them.
You can refer the Ad Placement and Scenes documents in OpenMediation Help Center for detail information.
Configuration of Ad Instance for Ad Placement
Click on Mediation in the left navigation bar Setup to go to the monetize function page.
Select the placement that needs to be configured, and click +Add Instance in the instance sub-interface to configure instance information.
You can get the ad network drop-down menu by clicking on the Ad Network, and then click “Huawei” to select Huawei as an ad network.
When you click on the ad network list to select Huawei Ads, you’ll see a list of instance additions, which you can start configuring by clicking on .
Configure Basic Information of Instances.
Note that, Unit ID must be same with the ID you got from Huawei Ads Platform
You can configure eCPM for ad instance manually.
Don’t forget enabling the instances.
You can refer the Ad Instance documents in OpenMediation Help Center for detail information.
Setting Mediation Rule
In the Setup>Mediation Tab, select the placement that needs to be configured, and click +Add Mediation Rule in the Mediation Rule sub-interface to configure mediation rule.
Enter basic information.
Click “Advanced Options”.
Enter Advanced Options information.
Enable Mediation rule.
You can refer the Mediation Rule Settings documents in OpenMediation Help Center for detail information.
3. Development Process on Source Code
After performing console operations for Huawei Ads and OpenMediation, we need to add some dependency to our project. First, please add the following maven URLs to your project-level build.gradle file.
Then, add the following to in dependencies section of your application-level build.gradle file.
You must add the following to your Proguard configuration file (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt) if you are using Porguard in your application. Failed to do so will lead to errors.
Note:
The stages mentioned after this section were prepared for developers who do not have any Openmediation Integration in their project. If you have completed the Openmediation Android SDK Development Steps before, you can skip the rest of this section.
Initialization OpenMediation SDK
Before you can fetch ads from OpenMediation Platform, you should first initialize the OpenMediation SDK when your app started. To do so, we suggest to call OpenMediation SDK’s init() method within onCreate() of an Application or Activity as below:
Note : APP KEY can only be obtained by creating apps on OpenMediation
After performing all of operations mentioned above, you can start to develop ad units.
- Banner Ad
To use Banner ads in Native android apps, please check the OpenMediation Mediation SDK. Click here to get more information about OpenMediation Mediation SDKs Banner Ad development.
- Interstitial Ad
To use Interstitial ads in Native android apps, please check the OpenMediation Mediation SDK. Click here to get more information about OpenMediation Mediation SDKs Interstitial Ad development.
- Rewarded Video Ad
To use Rewarded Video ads in Native android apps, please check the OpenMediation Mediation SDK. Click here to get more information about OpenMediation Mediation SDKs Rewarded Ad development.
- Native Ads
To use Native ads in Native android apps, please check the OpenMediation Mediation SDK. Click here to get more information about OpenMediation Mediation SDKs Native Ad development.
Conclusion
- You can perform Ad Mediation with using Huawei Ads and OpenMediation Platforms.
- The integration process of the Huawei Ads Adapter for OpenMediation SDK consists of several console operations on both the Huawei Ads side and the OpenMediation side and some development steps on source code.
- If you want to browse the Huawei Ads Adapter source code you can also refer to this link.