将 LG U+AD 与中介集成
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本指南适用于有兴趣将 Google 移动广告中介与 LG U+AD 搭配使用的发布商。本指南将逐步介绍如何设置中介适配器以与您当前的 Android 应用搭配使用,以及如何配置其他设置。
前提条件
将 LG U+AD 添加到您的项目中
添加广告资源网适配器和 SDK
从前文中的链接下载 LG U+AD SDK 和适配器。
在 Android Studio 中,将适配器和 SDK 文件添加到项目的 libs
文件夹中。确保您的应用级 Gradle 文件包含以下内容:
Kotlin
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar", "*.jar"))))
// ...
}
Groovy
dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
// ...
}
按照 LG U+AD 文档中的说明修改 AndroidManifest.xml
文件。
您的应用无需直接调用 LG U+AD,Google 移动广告 SDK 会调用 LG U+AD 适配器来代表您提取广告。如有必要,您可以指定任何其他请求参数。本页面的其余部分详细介绍了如何向 LG U+AD 提供更多信息。
使用 Activity 实例初始化您的广告对象
在新广告对象(例如 AdManagerAdView
)的构造函数中,您必须传入类型为 Context
的对象。使用中介时,此 Context
会传递到其他广告联盟。某些广告联盟需要类型为 Activity
且条件更严格的 Context
,并且如果没有 Activity
实例,可能无法投放广告。因此,我们建议在初始化广告对象时传入 Activity
实例,以确保从您所有参与中介的广告联盟获得一致的体验。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThis guide helps publishers integrate LG U+AD into their Android apps using Google Mobile Ads mediation.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need an Android app with the Google Mobile Ads SDK and a Google Ad Manager account with mediation configured.\u003c/p\u003e\n"],["\u003cp\u003eThe integration process involves adding the LG U+AD SDK and adapter to your project and configuring your AndroidManifest.xml.\u003c/p\u003e\n"],["\u003cp\u003eEnsure optimal ad serving by initializing your ad objects with an Activity instance for compatibility with mediated ad networks.\u003c/p\u003e\n"]]],[],null,["# Integrate LG U+AD with Mediation\n\nThis guide is intended for publishers who are interested in using Google\nMobile Ads mediation with **LG U+AD**. It walks\nthrough the setup of a mediation adapter to work with your current Android app\nand the configuration of additional settings.\n\n| LG U+AD Resources |\n|-------------------------------------------------------|\n| [Documentation](https://ad.uplus.co.kr/index.html) |\n| [SDK](https://ad.uplus.co.kr/index.html) |\n| [Adapter](https://ad.uplus.co.kr/index.html) |\n| [Customer support](https://ad.uplus.co.kr/index.html) |\n\nPrerequisites\n-------------\n\n- An Android app with\n\n Google Mobile Ads SDK\n\n integrated. (If you don't\n have one, see [Get Started](/ad-manager/mobile-ads-sdk/android/quick-start).)\n\n- A Google Ad Manager account with [Mediation for mobile\n apps](//support.google.com/admanager/answer/6272813) configured.\n\nAdd LG U+AD to your project\n---------------------------\n\n### Include network adapter and SDK\n\nDownload the LG U+AD SDK and adapter from the\n[previous links](#resources).\n\nIn Android Studio, include the adapter and SDK files in your project's `libs`\nfolder. Make sure that your app-level Gradle file includes the following: \n\n### Kotlin\n\n dependencies {\n implementation(fileTree(mapOf(\"dir\" to \"libs\", \"include\" to listOf(\"\\*.aar\", \"\\*.jar\"))))\n // ...\n }\n\n### Groovy\n\n dependencies {\n implementation fileTree(dir: 'libs', include: \\['\\*.aar', '\\*.jar'\\])\n // ...\n }\n\n### Configure the AndroidManifest.xml file\n\nModify your `AndroidManifest.xml` file as instructed in the\nLG U+AD documentation.\n\nYour app doesn't need to call LG U+AD\ndirectly---\n\nGoogle Mobile Ads SDK\n\ncalls the\nLG U+AD adapter to fetch ads on your behalf. If necessary, you can\nspecify any additional request parameters.\nThe rest of this page details how to provide more information to\nLG U+AD.\n\n### Initialize your ad object with an Activity instance\n\nIn the constructor for a new ad object (for example,\n\n[`AdManagerAdView`](/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/admanager/AdManagerAdView)),\n\nyou must pass in an object of type\n[`Context`](//developer.android.com/reference/android/content/Context).\nThis `Context` is passed on to other ad networks when using mediation. Some\nad networks require a more restrictive `Context` that is of type\n[`Activity`](//developer.android.com/reference/android/app/Activity)\nand may not be able to serve ads without an `Activity` instance. Therefore,\nwe recommend passing in an `Activity` instance when initializing ad objects\nto ensure a consistent experience with your mediated ad networks."]]