Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samyak2403/nativeads-recyclerview
https://github.com/samyak2403/nativeads-recyclerview
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/samyak2403/nativeads-recyclerview
- Owner: samyak2403
- License: mit
- Created: 2024-08-10T18:14:58.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-12T10:07:45.000Z (5 months ago)
- Last Synced: 2024-08-12T20:16:40.283Z (5 months ago)
- Language: Kotlin
- Size: 433 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## NativeAds RecyclerView Library
>Android library for add Naive Ads into RecyclerView list items.![pv](https://pageview.vercel.app/?github_user=NativeAds-Recyclerview)
## Update
- Updated to the latest version of Admob SDK
- Supported on Android SDK 30, 31, 32, 33, 34
- Updated RVAdapter to Kotlin## For developer
To make your app can earn more revengue ` by Showing Native Ads into RecyclerView list items `. Please check more details from below.## How to use NaiveAds RecyclerView Library
Step 1. Add the JitPack repository to your build file
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
If you are using Android Studio Bumble bee or latest version, add JitPack repository to `settings.gradle` file.
```
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } // add this line
}
}
```
Step 2. Add the dependency
dependencies {
implementation 'com.github.samyak2403:NativeAds-Recyclerview:1.0'
}Step 3. Add below code to setup your Adapter by Kotlin.
recyclerView.layoutManager = LinearLayoutManager(this@MainActivity)
val admobNativeAdAdapter: AdmobNativeAdAdapter = AdmobNativeAdAdapter.Builder
.with(
"ca-app-pub-3940256099942544/2247696110", //Create a native ad id from admob console
myAdapter, //The adapter you would normally set to your recyClerView
"medium" //Set it with "small","medium" or "custom"
)
.adItemIterval(2) //native ad repeating interval in the recyclerview
.build()
recyclerView.adapter = admobNativeAdAdapter
Add below code to setup your Adapter by Java.
AdmobNativeAdAdapter admobNativeAdAdapter=AdmobNativeAdAdapter.Builder
.with(
"ca-app-pub-3940256099942544/2247696110",//Create a native ad id from admob console
myAdapter,//The adapter you would normally set to your recyClerView
"medium"//Set it with "small","medium" or "custom"
)
.adItemIterval(2)//native ad repeating interval in the recyclerview
.build();
recyclerView.setAdapter(admobNativeAdAdapter);//set your RecyclerView adapter with the admobNativeAdAdapter## Demo
Native ads Small Layout | Native ads Medium Layout
:-------------------------:|:-------------------------:
|