Android AdMob Mediation Adapter supports all our ad units including the unique Interscroller ad unit.
AdMob/ display.io ad units mapping:
display.io | AdMob | ||
![]() |
Interscroller | Banner | |
![]() |
Headline Video | Banner | |
![]() |
Interstitial | Interstitial | |
![]() |
Infeed |
Banner | |
![]() |
Medium Rectangle | Banner | |
![]() |
Banner | Banner | |
To set it up:
1. Add the adapter to your project
Edit your project's build.gradle file in order to declare our maven repository:
repositories {
google()
jcenter()
maven { url "https://maven.display.io/" }
}
Add the following dependencies to your app-module's build.gradle file:
implementation ‘com.brandio.ads:sdk:4.6.2’
implementation ‘com.brandio.ads:google-ads-adapter:4.6.1'
Follow guide to initialize DisplayIO SDK.
2. Create a Google AdMob account and register an app.
3. Use Quick start from Google to setup AdMob SDK.
4. Create a mediation group.
5. In Ad sources section switch off AdMob Network and add a custom event for each ad unit using Class Name com.brandio.ads.adapters.googleads.InterstitialAdapter for Interstitial ad unit or com.brandio.ads.adapters.googleads.InfeedAdapter for Infeed ad unit or com.brandio.ads.adapters.googleads.InterscrollerAdapter for Interscroller ad unit or com.brandio.ads.adapters.googleads.BannerAdapter for Banner ad unit or com.brandio.ads.adapters.googleads.MediumRectangleAdapter for Medium Rectangle ad unit or com.brandio.ads.adapters.googleads.HeadlineVideoAdapter for HeadlineVideo ad unit
and Parameter: <PLACEMENT_ID> where <PLACEMENT_ID> parameter taken from display.io apps page.
Note: Interscroller unit also requires position of ad in your RecyclerView custom event data:
6. Use Banner (Infeed) or Interstitial tutorials to get ads from AdMob.
7. Infeed could be added in RecyclerView by passing it as adapter’s constructor argument:
RecyclerViewAdapter( ... , @NonNull AdView adView) {
...
this.adView = adView;
}
And be shown in particular position with help of RecyclerView.ViewHolder subclass in RecyclerView.Adapter.onCreateViewHolder method:
...
static class AdHolder extends RecyclerView.ViewHolder {
AdHolder(View itemView) {
super(itemView);
}
}
...
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull final
ViewGroup parent, int viewType) {
...
return new AdHolder(adView);
}
...
9. Interscroller could be added in RecyclerView like Banner but it require additional step: Set up your placement with field to store reference to parent (RecyclerView object) Make sure you call it after DisplayIO SDK has beed initialized:
try {
InterscrollerPlacement placement = (InterscrollerPlacement) Controller
.getInstance().getPlacement(IS_PLACEMENT_ID);
placement.setParentRecyclerView(recyclerView);
} catch (DioSdkException e) {
e.printStackTrace();
}
Comments
0 comments
Please sign in to leave a comment.