One of the main earning sources for applications is monetization. The main two monetization network is Admob & Facebook. Sometimes we want to show Native Ads in recycleview so that we can show more Ads and can earn more. But showing Native Ads into recycleview is so hard and need to write bipolar codes. So in this library, I try to make these things easy for developers. Developers can easily integrate Admob and Facebook Native ads as well as Banner Ads into recycleview. The main feature of this library is
- Facebook Native Ads
- Facebook Banner Ads
- Facebook Native Banner Ads
- Admob Native Ads
- Admob Banner Ads
Home Page | Admob Banner | Facebook Banner | Facebook Native | Facebook Native Banner | Admob Native |
Add this dependency in your build.gradle
:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.pavelsust:AdsAdapterWrapper:1.0.4'
implementation 'com.facebook.android:audience-network-sdk:6.+' // facebook ads
implementation 'com.google.android.gms:play-services-ads:20.6.0' // Google Ads
}
class AppController :Application(){
override fun onCreate() {
super.onCreate()
MultiDex.install(this)
AudienceNetworkAds.initialize(this)
MobileAds.initialize(this)
}
}
-> Add Internet permissions and Application class in your Androidmanifest
<uses-permission android:name="android.permission.INTERNET" />
<application>
android:name=".AppController"
......................
......................
</application>
val admobBanner = AdmobBannerAdAdapter.Builder.with(requireActivity() , "AD UNIT ID", your adapter)
.adItemInterval(5).build()
binding.recycleview.adapter = admobBanner
// Here we have two type view
- medium
- small
val admobNative = AdmobNativeAdAdapter.Builder.with("AD UNIT ID", your adapter, "medium")
.adItemInterval(5).build()
binding.recycleview.adapter = admobNative
val facebookBanner = FacebookBannerAdAdapter.Builder.with(requireActivity() , "FACEBOOK BANNER AD ID" , Your adapter)
.adItemInterval(5).build()
binding.recycleview.adapter = facebookBanner
val facebookNative = FacebookNativeAdAdapter.Builder.with( "FACEBOOK NATIVE AD ID" , Your Adapter)
.adItemInterval(5).build()
binding.recycleview.adapter = facebookNative
val facebookNativeBanner = FacebookNativeBannerAdsAdapter.Builder.with( "FACEBOOK NATIVE BANNER AD ID" , Your Adapter)
.adItemInterval(5).build()
binding.recycleview.adapter = facebookNativeBanner
Licensed under the MIT License. See the LICENSE file for more details.