将 Flurry 与中介集成
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本指南适用于希望将 Google 移动广告中介与 Flurry 搭配使用的发布商。本指南将逐步介绍如何设置中介适配器以与您当前的 Android 应用搭配使用,以及如何配置其他设置。
前提条件
将 Flurry 添加到项目中
添加广告资源网适配器和 SDK
从前文中的链接下载 Flurry 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'])
// ...
}
按照 Flurry 文档中的说明修改 AndroidManifest.xml
文件。
您的应用无需直接调用 Flurry,Google 移动广告 SDK 会调用 Flurry 适配器来代表您提取广告。如有必要,您可以指定任何其他请求参数。本页面的其余部分详细介绍了如何向 Flurry 提供更多信息。
使用 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 explains how to integrate Flurry ads into your Android app using Google Mobile Ads Mediation.\u003c/p\u003e\n"],["\u003cp\u003ePublishers need an existing Android app with Google Mobile Ads SDK and a Google Ad Manager account configured for mediation.\u003c/p\u003e\n"],["\u003cp\u003eThe integration process involves adding the Flurry SDK and adapter to your project and configuring your AndroidManifest.xml file.\u003c/p\u003e\n"],["\u003cp\u003eInitialization of ad objects should be done with an Activity instance for better compatibility with mediated ad networks.\u003c/p\u003e\n"]]],[],null,["This guide is intended for publishers who are interested in using Google\nMobile Ads mediation with **Flurry**. It walks\nthrough the setup of a mediation adapter to work with your current Android app\nand the configuration of additional settings.\n\n| Flurry Resources |\n|------------------------------------------------------------------------|\n| [Documentation](http://www.flurry.com/) |\n| [SDK](http://dev.flurry.com/uploadVersionSelectProject.do) |\n| [Adapter](http://github.com/flurry/FlurryAdapterForDFPAndAdMobAndroid) |\n| [Customer support](mailto:support@flurry.com) |\n\nPrerequisites\n\n- An Android app with Google Mobile Ads SDK 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 Flurry to your project\n\nInclude network adapter and SDK\n\nDownload the Flurry 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\nKotlin \n\n dependencies {\n implementation(fileTree(mapOf(\"dir\" to \"libs\", \"include\" to listOf(\"\\*.aar\", \"\\*.jar\"))))\n // ...\n }\n\nGroovy \n\n dependencies {\n implementation fileTree(dir: 'libs', include: \\['\\*.aar', '\\*.jar'\\])\n // ...\n }\n\nConfigure the AndroidManifest.xml file\n\nModify your `AndroidManifest.xml` file as instructed in the\nFlurry documentation.\n\nYour app doesn't need to call Flurry\ndirectly---Google Mobile Ads SDK calls the\nFlurry 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\nFlurry.\n\nInitialize 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."]]