# 激励广告

<div align="left"><figure><img src="/files/tMYgMBI9RdryrLwRrXeg" alt=""><figcaption></figcaption></figure></div>

激励广告适用于用户需要奖励获取时，完成全屏广告观看，引导用户在规定时间内持续使用，展示完成后，获得应用内奖励，本指南完成用户在应用中集成与配置激励广告

## 前提

用户完成广告初始化步骤[入门指南](/copy-of-cn/jie-kou-wen-dang/android/kai-shi/ru-men-zhi-nan.md)

## 初始化

```java
Adx3RewardAdView view = new Adx3RewardAdView(this,"UnitID");
```

## 设置广告窗体方向

`0`-垂直 `1`-横向，可进行广告位方向配置，若不设置默认为垂直广告，用户可跳过设置

```java
view.setOpt(0); 
```

{% hint style="info" %}
激励广告展示后，用户需根据播放完成回调完成自身业务，如播放完成后，给予用户奖励等，完成后，自动回收与关闭广告
{% endhint %}

## 广告事件监听设置

```java
 view.setListener(new AdListener() {
            @Override
            public void show() {

            }

            @Override
            public void loadFaild() {

            }

            @Override
            public void loadSucces() {

            }

            @Override
            public void adClose() {
                finish();
            }

            @Override
            public void adClick() {
            }

            @Override
            public void adComplate() {
                ToastUtil.toast(getApplicationContext(),"Reward AD is complate");
            }

            @Override
            public void adSkip() {

            }

            @Override
            public void clickUrl(String url) {

            }
        });
```

事件监听描述参考[横幅广告](/copy-of-cn/jie-kou-wen-dang/android/guang-gao-ge-shi/heng-fu-guang-gao.md#cao-zuo-hui-tiao-fang-fa-miao-shu-yu-jie-shao)

## 广告加载

```java
view.loadAd();
```


---

# Agent Instructions: 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://docs.adx3.io/copy-of-cn/jie-kou-wen-dang/android/guang-gao-ge-shi/ji-li-guang-gao.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.
