{"_id":"595e3174c6fd260015d25e2d","project":"574ff4bd3fa1870e00889ba6","version":{"_id":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":26,"createdAt":"2016-06-02T08:56:29.492Z","releaseDate":"2016-06-02T08:56:29.492Z","categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a","5a0322bf044b6f001c236e36","5a79897c5b6e430030746df6","5a79898c2b2d5f0012cbab63","5ab3b5e3d2d1e2006252a8f2","5b1a43bd678eab0003aa54a4","5b6d95e29d346300038baff3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"category":{"_id":"57b486ae0d2b640e00e9d3f5","__v":0,"project":"574ff4bd3fa1870e00889ba6","version":"574ff4bd3fa1870e00889ba9","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-17T15:45:50.062Z","from_sync":false,"order":7,"slug":"native-ads-mediation-layer","title":"Android SDK"},"user":"5770fa1ce5a0000e0023c680","githubsync":"","__v":2,"parentDoc":null,"updates":["5971f12d4b01cc001b8bbb6e","597f1b7981a71f0014606190"],"next":{"pages":[],"description":""},"createdAt":"2017-07-06T12:47:48.345Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":16,"body":"This guide is intended for publishers who are interested in serving:\n\n* Banner Ads\n* MRect Ads\n* Fullscreen Interstitials\n\nfrom PubNative using the **Admob** mediation network. This document will include help the setting up of the mediation adapter with your Android application.\n[block:api-header]\n{\n  \"title\": \"Requirements\"\n}\n[/block]\n* AdMob Android SDK\n* PubNative Android iOS Adapter\n* An App Token obtained from PubNative Dashboard\n* A Placement Name configured and obtained from the PubNative Dashboard\n\n**Note:** At the moment, this adapter project is supporting the versions down below:\n* **Pubnative SDK:** 2.0.11\n* **AdMob:**10.2.6\n* **Android:**Min API level 15\n[block:api-header]\n{\n  \"title\": \"Install AdMob Android SDK\"\n}\n[/block]\nDownload and install the AdMob Android SDK as described in the [documentation](https://developers.google.com/admob/android/quick-start).\n[block:api-header]\n{\n  \"title\": \"Install PubNative AdMob Android Adapter\"\n}\n[/block]\n## Gradle\n\nThe PubNative Admob Adapter is available via jCenter. To add the sdk dependency, open your project's build.gradle and update the repositories and dependencies blocks as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"repositories {\\n    // ... other project repositories\\n    jcenter()\\n}\\n\\n// ...\\n\\ndependencies {\\n    // ... other project dependencies\\n    compile 'net.pubnative:adapters.admob:10.2.6-2.0.11'\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\nThe adapter library includes the Pubnative Android SDK. So there's no need to import it as an extra step.\n\n## Proguard\n\nIf you are using **Proguard** for you Android builds then you should add the following lines to your **proguard** file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-keepattributes Signature\\n-keep class net.pubnative.** { *; }\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Adding a Custom Event of Interstitial in AdMob\"\n}\n[/block]\n1. Sign in to your Admob account\n\n2. Choose an application to configure mediation\n\n3. Create new Ad Unit\n\n4. Go to Mediation section\n\n5. Create a new mediation or modify existing one\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/8659b91-AdMob_Mediation.png\",\n        \"AdMob Mediation.png\",\n        852,\n        603,\n        \"#dd4338\"\n      ]\n    }\n  ]\n}\n[/block]\n6. Choose an Interstitial type\n\n7. Add new Custom Event\n\n8. Setup all parameters as you want at next screen, and go to next\n\n9. Enter class name\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"net.pubnative.sdk.adapters.admob.PNInterstitialAdapter\",\n      \"language\": \"java\",\n      \"name\": \"Interstitial Class Name\"\n    }\n  ]\n}\n[/block]\n10. In parameters add the string with app token and placement name, like this: {\"app_token\":<YOUR_APP_TOKEN>,\"placement\":<PLACEMENT_NAME>}\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/94efdb0-AdMob3.png\",\n        \"AdMob3.png\",\n        794,\n        419,\n        \"#8e8588\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Adding a Custom Event of Banner or MRect in AdMob\"\n}\n[/block]\n1. Sign in to your Admob account\n\n2. Choose an application to configure mediation\n\n3. Create new Ad Unit\n\n4. Go to Mediation section\n\n5. Create a new mediation or modify existing one\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/80d3919-AdMob_Mediation.png\",\n        \"AdMob Mediation.png\",\n        852,\n        603,\n        \"#dd4338\"\n      ]\n    }\n  ]\n}\n[/block]\n6. Choose a Banner type\n\n7. Add new Custom Event\n\n8. Setup all parameters as you want at next screen, and go to next\n\n9. Enter class name\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"net.pubnative.sdk.adapters.admob.PNBannerAdapter\",\n      \"language\": \"java\",\n      \"name\": \"Banner Class Name\"\n    }\n  ]\n}\n[/block]\n10. In parameters add the string with app token and placement name, like this: {\"app_token\":<YOUR_APP_TOKEN>,\"placement\":<PLACEMENT_NAME>}\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/75b2e70-AdMob_4.png\",\n        \"AdMob 4.png\",\n        793,\n        423,\n        \"#8a8b8c\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"admob-adapter","type":"basic","title":"AdMob Adapter Android"}

AdMob Adapter Android


This guide is intended for publishers who are interested in serving: * Banner Ads * MRect Ads * Fullscreen Interstitials from PubNative using the **Admob** mediation network. This document will include help the setting up of the mediation adapter with your Android application. [block:api-header] { "title": "Requirements" } [/block] * AdMob Android SDK * PubNative Android iOS Adapter * An App Token obtained from PubNative Dashboard * A Placement Name configured and obtained from the PubNative Dashboard **Note:** At the moment, this adapter project is supporting the versions down below: * **Pubnative SDK:** 2.0.11 * **AdMob:**10.2.6 * **Android:**Min API level 15 [block:api-header] { "title": "Install AdMob Android SDK" } [/block] Download and install the AdMob Android SDK as described in the [documentation](https://developers.google.com/admob/android/quick-start). [block:api-header] { "title": "Install PubNative AdMob Android Adapter" } [/block] ## Gradle The PubNative Admob Adapter is available via jCenter. To add the sdk dependency, open your project's build.gradle and update the repositories and dependencies blocks as follows: [block:code] { "codes": [ { "code": "repositories {\n // ... other project repositories\n jcenter()\n}\n\n// ...\n\ndependencies {\n // ... other project dependencies\n compile 'net.pubnative:adapters.admob:10.2.6-2.0.11'\n}", "language": "groovy" } ] } [/block] The adapter library includes the Pubnative Android SDK. So there's no need to import it as an extra step. ## Proguard If you are using **Proguard** for you Android builds then you should add the following lines to your **proguard** file: [block:code] { "codes": [ { "code": "-keepattributes Signature\n-keep class net.pubnative.** { *; }", "language": "text" } ] } [/block] [block:api-header] { "title": "Adding a Custom Event of Interstitial in AdMob" } [/block] 1. Sign in to your Admob account 2. Choose an application to configure mediation 3. Create new Ad Unit 4. Go to Mediation section 5. Create a new mediation or modify existing one [block:image] { "images": [ { "image": [ "https://files.readme.io/8659b91-AdMob_Mediation.png", "AdMob Mediation.png", 852, 603, "#dd4338" ] } ] } [/block] 6. Choose an Interstitial type 7. Add new Custom Event 8. Setup all parameters as you want at next screen, and go to next 9. Enter class name [block:code] { "codes": [ { "code": "net.pubnative.sdk.adapters.admob.PNInterstitialAdapter", "language": "java", "name": "Interstitial Class Name" } ] } [/block] 10. In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>} [block:image] { "images": [ { "image": [ "https://files.readme.io/94efdb0-AdMob3.png", "AdMob3.png", 794, 419, "#8e8588" ] } ] } [/block] [block:api-header] { "title": "Adding a Custom Event of Banner or MRect in AdMob" } [/block] 1. Sign in to your Admob account 2. Choose an application to configure mediation 3. Create new Ad Unit 4. Go to Mediation section 5. Create a new mediation or modify existing one [block:image] { "images": [ { "image": [ "https://files.readme.io/80d3919-AdMob_Mediation.png", "AdMob Mediation.png", 852, 603, "#dd4338" ] } ] } [/block] 6. Choose a Banner type 7. Add new Custom Event 8. Setup all parameters as you want at next screen, and go to next 9. Enter class name [block:code] { "codes": [ { "code": "net.pubnative.sdk.adapters.admob.PNBannerAdapter", "language": "java", "name": "Banner Class Name" } ] } [/block] 10. In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>} [block:image] { "images": [ { "image": [ "https://files.readme.io/75b2e70-AdMob_4.png", "AdMob 4.png", 793, 423, "#8a8b8c" ] } ] } [/block]