> For the complete documentation index, see [llms.txt](https://intowow.gitbook.io/crystalexpress-documentation-v3-x/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intowow.gitbook.io/crystalexpress-documentation-v3-x/mediation-guidelines/mediating-intowow/dfp/android.md).

# Android

The CrystalExpress DFP Custom Event allows DFP publishers to add CrystalExpress as a Custom Ad Network within the DFP platform.

CrystalExpress provides two ad formats for DFP mediation. The relationship between DFP ad unit and ad format in CrystalExpress is as following:

| DFP ad unit  | AD format from CrystalExpress |
| ------------ | ----------------------------- |
| Banner       | Card AD                       |
| Interstitial | Splash AD                     |

**NOTICE: The aspect ratio for CrystalExpress ad is 16:9, 4:3 or 1:1.**

Before adding CrystalExpress as Custom network, you have to integrate DFP SDK by following the instructions on the [DFP website](https://developers.google.com/mobile-ads-sdk/docs/dfp/android/quick-start).

NECESSARY STEPS:

* Get CrystalExpress SDK and Crystal ID.
* Integrate the CrystalExpress SDK.

  > For SDK 3.32 and above, there is no need for moat-x.jar anymore. If there was one in libs folder, please remove it. (For previous SDK version, please still copy moat-x.jar to the libs folder of your app project.
* Add CrystalExpress DFP Custom Event into project.
* Configure DFP dash board to mediate CrystalExpress.

## Get CrystalExpress SDK and Crystal ID

Please contact your Intowow account manager. We will provide the right version of SDK and Crystal ID according to your needs.

## Integrate the CrystalExpress SDK.

Please refer to the [Setup and Initialize SDK](/crystalexpress-documentation-v3-x/android-sdk/quickstart-guide/step-1.-setup-and-initialize-sdk.md) document in Android SDK.

## Add CrystalExpress's DFP Custom Event into project

### Step 1

Contact Intowow account manager for CrystalExpress DFP Custom Event and sample code.

### Step 2

Unzip `ce-[premium|lite]-global-custom-event-SDKversion.zip`.

* **For Banner**

  Add file `CECustomEventCard.java`from `/CustomEvents/DFP/Banner` to your app's project folder

  * Size of AdView could be assigned in two ways.
    1. Set the size defined by DFP API

       e.g. `adView.setAdSize(AdSize.BANNER);`
    2. Custom size

       e.g. `adView.setAdSize(new AdSize(300, 169));`
* **For Interstitial AD**

  Add file `CECustomEventInterstitial.java` from `/CustomEvents/DFP/Interstitial/` to your app's project folder.

For further integration issues, please check the sample code within download folder.

## Proguard (Optional)

If you are using Proguard to obfuscate your code, please refer to the [proguard](/crystalexpress-documentation-v3-x/android-sdk/quickstart-guide/step-3.-proguard.md) document in Android SDK.

## The Layout of CrystalExpress AD

In DFP Custom Event, our SDK will keep the aspect ratio of creatives and try to fit the ad view that you bind to DFP.

If the aspect ratio for the ad view to be bound and the creative are inconsistent, the return ad will be filled with black background to match the aspect ratio.

![](/files/-LGU_veOymtzx0Z3gbFR)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://intowow.gitbook.io/crystalexpress-documentation-v3-x/mediation-guidelines/mediating-intowow/dfp/android.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
