Putting an AdMob native ad in a listView

后端 未结 4 1187
时光取名叫无心
时光取名叫无心 2020-12-14 03:00

I\'d like to use the new AdMob native ad functionality in my app. I want to put a native ad within a listView, where every 20th item or so in the list is an ad. Is it possib

4条回答
  •  没有蜡笔的小新
    2020-12-14 03:31

    I guess Admobadapter lib is what you are looking for...it wraps your adapter to automatically fetch and show ad blocks in every X items in your listview or recyclerview. You just do it as follows: 1. setup wrapper of suitable type (there are basically 4 wrappers - for a listview, for a recyclerview to show Advanced ads and 2 ones for Express ads) 2. inject your adapter into the wrapper 3. inject wrapper to the listview/recyclerview 4. fill up your adapter with your data, raise onDataSetChanged() then the wrapper will do the stuff itself.

    Also it supports Express native ads and Advanced native ads as well. According to this issue they are going to add a Maven/Gradle support soon. Good luck!

提交回复
热议问题