Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dora4/dora-ad-android
朵拉广告SDK
https://github.com/dora4/dora-ad-android
Last synced: 3 days ago
JSON representation
朵拉广告SDK
- Host: GitHub
- URL: https://github.com/dora4/dora-ad-android
- Owner: dora4
- License: apache-2.0
- Created: 2024-11-11T09:15:18.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T14:04:48.000Z (3 months ago)
- Last Synced: 2024-12-15T03:38:14.198Z (about 2 months ago)
- Language: Kotlin
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dora-ad-android
![Release](https://jitpack.io/v/dora4/dora-ad-android.svg)
--------------------------------#### Gradle依赖配置
添加以下代码到项目根目录下的settings.gradle.kts
```kotlin
dependencyResolutionManagement {
repositories {
maven { setUrl("https://jitpack.io") }
}
}
```
添加以下代码到app模块的build.gradle.kts
```kotlin
dependencies {
// 扩展包必须在有主框架dora的情况下使用
implementation("com.github.dora4:dora:1.2.29")
implementation("com.github.dora4:dcache-android:2.5.20")
implementation("com.github.dora4:dora-ad-android:1.14")
implementation("io.github.youth5201314:banner:2.2.2")
}
```#### 使用方式
在Application中添加AdService的配置
```kotlin
RetrofitManager.initConfig {
mappingBaseUrl(AdService::class.java, "http://dorachat.com:9091")
}
```
将layout_banner_ad.xml添加到布局。
如
```xml```
加载横幅广告
```kotlin
BannerAd.loadBannerAds(this, "app_name", binding.banner as Banner)
```