{"_id":"5b8e345991c38b0003a0350e","project":"5429beef1163360800ed31fa","version":{"_id":"5429beef1163360800ed31fd","__v":22,"project":"5429beef1163360800ed31fa","createdAt":"2014-09-29T20:19:59.904Z","releaseDate":"2014-09-29T20:19:59.904Z","categories":["5429beef1163360800ed31fe","55e74e1f5d36b32b002563fa","55e7500a73169617001f2e86","55e76b8196131b2f00bf4b72","55e89569cdbb8a350096df9c","55f8935eb089b71700a8364e","55f8a67d3bb4bb0d0022d093","55f9dbefc7ef770d00d9bf6d","5601c21a22ecf60d002b27b3","5601c21ff12aee0d001bb06e","5601c2256c7b610d00280db5","5601c22c22ecf60d002b27b4","5603738d0c78b00d0039af47","5626f70bfcbbc621004ebf52","566f7a1ae144ab0d00e9732f","566f85ca7820960d00c3b93d","56708ce43a32d20d00c45cbf","56708d436995210d003aad8e","5736471abe10a9200030732c","57a82c7aff9bd30e00a6f1c1","591b8500e3992319007190f4","5a3718305c66a60012d960ba"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"566f85ca7820960d00c3b93d","pages":[],"project":"5429beef1163360800ed31fa","version":"5429beef1163360800ed31fd","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-15T03:15:22.182Z","from_sync":false,"order":3,"slug":"integrating-for-apps","title":"Integrating for Apps"},"user":"592d2246b9d6342500d54f62","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-09-04T07:29:29.110Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Welcome to Polymorph iOS SDK Demand Partner Integration wiki! Please check out the **[Android SDK](https://dev.getpolymorph.com/docs/android-sdk)** section before integrating with any partners.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Integrating 3rd Party Networks\"\n}\n[/block]\nThis section details how to integrate other networks for mediation.\n\n**Basic Integration Guidelines**\n\nCurrently, we have built adapters for 4 major ad networks. Depending on which network you wish to integrate, choose the corresponding subsection. However, before diving into one specific network, you have to follow these basic steps for any network you wish to integrate.\n\n1. Integrate network SDK into your project\n2. From the \"networks\" folder of the downloaded Polymorph SDK, copy the corresponding network adapter into your project\n3. Setup network specific data on Polymorph dashboard.\n\n**Facebook**\n\n1. The easiest way to integrate Audience Network SDK from Facebook is by adding following line to your gradle dependencies.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    compile 'com.facebook.android:audience-network-sdk:4.99.3'\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\nNOTE: Audience Network SDK is supported till **4.99.3** version\n\n2. Copy networks/FacebookAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.FacebookAdNetwork**)\n\nOn Polymorph dashboard,\n1. Click on the [**Programmatic**](https://console.getpolymorph.com/demand/#/) tab\n2. Click on the [**Bidders & Networks**](https://console.getpolymorph.com/demand/#/network) tab\n3. Click the [**+Network**](https://console.getpolymorph.com/demand/#/network/create/) button\n\nSelect \"Facebook\" from the \"mobile_sdk\" section and enter your facebook credentials. Credentials are used to fetch placement information and reports data for revenue optimization only.\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4c7f4e4-Screen_Shot_2018-01-29_at_12.18.30_AM.png\",\n        \"Screen Shot 2018-01-29 at 12.18.30 AM.png\",\n        1048,\n        614,\n        \"#3a4b5d\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce created, you will be taken to the network campaign screen where you need to fill in THREE fields\n* **Adapter Class Name** (The class name of the Polymorph SDK adapter in your app integration)\n* **Placement ID** key's value is your placement that Facebook gives after you register your app with them.\n* **App Token** can be found on facebook dashboard\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/dd7e465-Screen_Shot_2018-01-29_at_12.25.24_AM.png\",\n        \"Screen Shot 2018-01-29 at 12.25.24 AM.png\",\n        1372,\n        980,\n        \"#eeeff0\"\n      ]\n    }\n  ]\n}\n[/block]\n\n**MoPub**\n\n1. The easiest way to integrate MoPub SDK is by adding following lines to your gradle dependencies.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    compile('com.mopub:mopub-sdk-base:4.11.0:::at:::aar')\\n    compile('com.mopub:mopub-sdk-native-static:4.11.0@aar')\\n    compile('com.mopub.volley:mopub-volley:1.1.0@aar')\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\nNOTE: MoPub SDK version supported is 4.0.0 & above.\n\n2. Copy networks/MoPubAdNetwork.java from Polymorph SDK into your project. You must copy into **com.mopub.nativeads** package under **src/**\n\nFollow the same steps for setting up the network campaign on Polymorph dashboard as shown for Facebook\n\nNOTE: MoPub ads may not work if you copy mopub adapter class into a different package other than **com.mopub.nativeads**\n\n\n**InMobi**\n\n1. Download InMobi SDK from InMobi portal and copy InMobi-5.x.x.jar to your project's lib folder. Add add the following line to your gradle dependencies.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\nrepositories {\\n    flatDir {\\n        dirs 'libs'\\n    }\\n}\\n// ...\\ndependencies {\\n    compile(name:'InMobi-5.x.x', ext:'jar')\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\nNOTE: InMobi SDK version supported is 5.0.0 & above.\n\n2. Copy networks/InMobiAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.InMobiAdNetwork**)\n\nFollow the same steps for setting up the network campaign on Polymorph dashboard as shown on Facebook\n\n\n**Flurry**\n\n1. Download InMobi SDK from InMobi portal and copy InMobi-5.x.x.jar to your project's lib folder. Add add the following lines to your gradle dependencies.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"repositories {\\n    flatDir {\\n        dirs 'libs'\\n    }\\n}\\n// ...\\ndependencies {\\n    compile(name:'FlurryAds-6.x.x', ext:'jar')\\n    compile(name:'FlurryAnalytics-6.x.x', ext:'jar')\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\nNOTE: Flurry SDK version supported is 6.1.0 & above.\n\n2. Copy networks/FlurryAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.FlurryAdNetwork**)\n\nFollow the same steps for setting up the network campaign on Polymorph dashboard as shown for Facebook\n\n\n**DFP**\n\n1. The easiest way to integrate DFP SDK is by adding following lines to your gradle dependencies.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    compile 'com.google.android.gms:play-services-ads:10.0.1'\\n    compile 'com.google.android.gms:play-services-location:10.0.1'\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\n2. Copy networks/DFPAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.DFPAdNetwork**)\n\nCheck this page on how to setup/enable API access for your DFP account (needing for pulling reports):\nhttps://developers.google.com/doubleclick-publishers/docs/start\n\nWhile adding the network, please note below:\n* **username**  - application name in dfp\n* **password**  - dfp network id\n* **access token**  - content of json file downloaded in `Create authentication credentials` section here: https://developers.google.com/doubleclick-publishers/docs/start\n\nAfter adding the network, you could follow the same steps for setting up the network campaign on Polymorph dashboard as shown on Facebook. \n\nPlease note that DFP custom template id is mandatory along with DFP placement id. We currently do not support the default DFP templates (app-install and content-ad), so we require you to create a custom template for the assets you want on the DFP dashboard, under Creatives -> Native Ad Formats. Please ensure you are using the following labels while defining a custom template, else you may not get the desired asset.\n\nHeadline - this is the label our adapter uses for Title\nBody - this is the label our adapter uses for Summary\nIconImage - this is the label for icon image\nMainImage - this is the label for main image\nCallToAction - this is the label for call-to-action (CTA)","excerpt":"","slug":"android-sdk-demand-partner-integration","type":"basic","title":"Android SDK Demand Partner Integrations"}

Android SDK Demand Partner Integrations


Welcome to Polymorph iOS SDK Demand Partner Integration wiki! Please check out the **[Android SDK](https://dev.getpolymorph.com/docs/android-sdk)** section before integrating with any partners. [block:api-header] { "type": "basic", "title": "Integrating 3rd Party Networks" } [/block] This section details how to integrate other networks for mediation. **Basic Integration Guidelines** Currently, we have built adapters for 4 major ad networks. Depending on which network you wish to integrate, choose the corresponding subsection. However, before diving into one specific network, you have to follow these basic steps for any network you wish to integrate. 1. Integrate network SDK into your project 2. From the "networks" folder of the downloaded Polymorph SDK, copy the corresponding network adapter into your project 3. Setup network specific data on Polymorph dashboard. **Facebook** 1. The easiest way to integrate Audience Network SDK from Facebook is by adding following line to your gradle dependencies. [block:code] { "codes": [ { "code": "dependencies {\n compile 'com.facebook.android:audience-network-sdk:4.99.3'\n}", "language": "groovy" } ] } [/block] NOTE: Audience Network SDK is supported till **4.99.3** version 2. Copy networks/FacebookAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.FacebookAdNetwork**) On Polymorph dashboard, 1. Click on the [**Programmatic**](https://console.getpolymorph.com/demand/#/) tab 2. Click on the [**Bidders & Networks**](https://console.getpolymorph.com/demand/#/network) tab 3. Click the [**+Network**](https://console.getpolymorph.com/demand/#/network/create/) button Select "Facebook" from the "mobile_sdk" section and enter your facebook credentials. Credentials are used to fetch placement information and reports data for revenue optimization only. [block:image] { "images": [ { "image": [ "https://files.readme.io/4c7f4e4-Screen_Shot_2018-01-29_at_12.18.30_AM.png", "Screen Shot 2018-01-29 at 12.18.30 AM.png", 1048, 614, "#3a4b5d" ] } ] } [/block] Once created, you will be taken to the network campaign screen where you need to fill in THREE fields * **Adapter Class Name** (The class name of the Polymorph SDK adapter in your app integration) * **Placement ID** key's value is your placement that Facebook gives after you register your app with them. * **App Token** can be found on facebook dashboard [block:image] { "images": [ { "image": [ "https://files.readme.io/dd7e465-Screen_Shot_2018-01-29_at_12.25.24_AM.png", "Screen Shot 2018-01-29 at 12.25.24 AM.png", 1372, 980, "#eeeff0" ] } ] } [/block] **MoPub** 1. The easiest way to integrate MoPub SDK is by adding following lines to your gradle dependencies. [block:code] { "codes": [ { "code": "dependencies {\n compile('com.mopub:mopub-sdk-base:4.11.0@aar')\n compile('com.mopub:mopub-sdk-native-static:4.11.0@aar')\n compile('com.mopub.volley:mopub-volley:1.1.0@aar')\n}", "language": "groovy" } ] } [/block] NOTE: MoPub SDK version supported is 4.0.0 & above. 2. Copy networks/MoPubAdNetwork.java from Polymorph SDK into your project. You must copy into **com.mopub.nativeads** package under **src/** Follow the same steps for setting up the network campaign on Polymorph dashboard as shown for Facebook NOTE: MoPub ads may not work if you copy mopub adapter class into a different package other than **com.mopub.nativeads** **InMobi** 1. Download InMobi SDK from InMobi portal and copy InMobi-5.x.x.jar to your project's lib folder. Add add the following line to your gradle dependencies. [block:code] { "codes": [ { "code": "\nrepositories {\n flatDir {\n dirs 'libs'\n }\n}\n// ...\ndependencies {\n compile(name:'InMobi-5.x.x', ext:'jar')\n}", "language": "groovy" } ] } [/block] NOTE: InMobi SDK version supported is 5.0.0 & above. 2. Copy networks/InMobiAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.InMobiAdNetwork**) Follow the same steps for setting up the network campaign on Polymorph dashboard as shown on Facebook **Flurry** 1. Download InMobi SDK from InMobi portal and copy InMobi-5.x.x.jar to your project's lib folder. Add add the following lines to your gradle dependencies. [block:code] { "codes": [ { "code": "repositories {\n flatDir {\n dirs 'libs'\n }\n}\n// ...\ndependencies {\n compile(name:'FlurryAds-6.x.x', ext:'jar')\n compile(name:'FlurryAnalytics-6.x.x', ext:'jar')\n}", "language": "groovy" } ] } [/block] NOTE: Flurry SDK version supported is 6.1.0 & above. 2. Copy networks/FlurryAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.FlurryAdNetwork**) Follow the same steps for setting up the network campaign on Polymorph dashboard as shown for Facebook **DFP** 1. The easiest way to integrate DFP SDK is by adding following lines to your gradle dependencies. [block:code] { "codes": [ { "code": "dependencies {\n compile 'com.google.android.gms:play-services-ads:10.0.1'\n compile 'com.google.android.gms:play-services-location:10.0.1'\n}", "language": "groovy" } ] } [/block] 2. Copy networks/DFPAdNetwork.java from Polymorph SDK into your project. You can copy into any java package under **src/** (example **com.xyz.networks.DFPAdNetwork**) Check this page on how to setup/enable API access for your DFP account (needing for pulling reports): https://developers.google.com/doubleclick-publishers/docs/start While adding the network, please note below: * **username** - application name in dfp * **password** - dfp network id * **access token** - content of json file downloaded in `Create authentication credentials` section here: https://developers.google.com/doubleclick-publishers/docs/start After adding the network, you could follow the same steps for setting up the network campaign on Polymorph dashboard as shown on Facebook. Please note that DFP custom template id is mandatory along with DFP placement id. We currently do not support the default DFP templates (app-install and content-ad), so we require you to create a custom template for the assets you want on the DFP dashboard, under Creatives -> Native Ad Formats. Please ensure you are using the following labels while defining a custom template, else you may not get the desired asset. Headline - this is the label our adapter uses for Title Body - this is the label our adapter uses for Summary IconImage - this is the label for icon image MainImage - this is the label for main image CallToAction - this is the label for call-to-action (CTA)