> For the complete documentation index, see [llms.txt](https://docs.targetpick.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.targetpick.io/targetpick_eng/android-sdk/splash.md).

# 스플래시

## 1.매체 광고 레이아웃

* XML

{% code title="레이아웃" lineNumbers="true" %}

```java
<RelativeLayout
    android:layout_gravity="bottom"
    android:id="@+id/splashArea"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:orientation="horizontal" >
</RelativeLayout>
```

{% endcode %}

* Code

{% code title="레이아웃 객체 ID 설정" lineNumbers="true" %}

```java
ViewGroup splashArea = findViewById(R.id.splashArea);
```

{% endcode %}

## 2.광고 데이터&#x20;

{% code title="데이터 객체 선언" lineNumbers="true" %}

```java
import com.mmc.man.data.AdData;
AdData adData = new AdData();
```

{% endcode %}

{% code title="광고 데이터 필수 값 세팅" lineNumbers="true" %}

```java
adData.major(id, apiMode, publisher, media, section, storeUrl, appId, appName, adWidth, adHeight);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="205"></th><th width="143"></th><th width="292"></th><th></th></tr></thead><tbody><tr><td><strong>parameter</strong></td><td><strong>type</strong></td><td><strong>contents</strong></td><td><strong>etc</strong></td></tr><tr><td>id</td><td>string</td><td>매체에서 사용할 광고 영역의 고유 id</td><td><br></td></tr><tr><td>apiMode</td><td>string</td><td>광고 타입 : AdConfig.API_INTER</td><td><br></td></tr><tr><td>publisher</td><td>int</td><td>퍼블리셔 코드</td><td><br></td></tr><tr><td>media</td><td>int</td><td>미디어 코드</td><td><br></td></tr><tr><td>section</td><td>int</td><td>섹션 코드</td><td><br></td></tr><tr><td>storeUrl</td><td>string</td><td>스토어 url</td><td><br></td></tr><tr><td>appId</td><td>string</td><td>패키지명</td><td><br></td></tr><tr><td>appName</td><td>string</td><td>앱 명</td><td><br></td></tr><tr><td>adWidth</td><td>int</td><td>노출되는 광고 영역 넓이 사이즈</td><td><br></td></tr><tr><td>adHeight</td><td>int</td><td>노출되는 광고 영역 높이 사이즈 </td><td><br></td></tr></tbody></table>

{% code title="앱사용자 나이 레벨" lineNumbers="true" %}

```java
adData.setUserAgeLevel(0);
```

{% endcode %}

<table data-header-hidden><thead><tr><th></th><th></th><th width="258"></th><th></th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong>type</strong></td><td><strong>contents</strong></td><td><strong>etc</strong></td></tr><tr><td>0</td><td>int</td><td>어린이 (만13세 미만)</td><td><br></td></tr><tr><td>1</td><td>int</td><td>청소년, 성인 (만13세 이상)</td><td><br></td></tr><tr><td>-1</td><td>int</td><td>알 수 없음</td><td><br></td></tr></tbody></table>

{% code title="퍼미션 사용 여부" lineNumbers="true" %}

```java
adData.isPermission(AdConfig.NOT_USED);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="246"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong>type</strong></td><td><strong>contents</strong></td><td><strong>etc</strong></td></tr><tr><td>AdConfig.USED</td><td>String</td><td>사용</td><td><br></td></tr><tr><td>AdConfig.NOT_USED</td><td>String</td><td>미사용</td><td><br></td></tr></tbody></table>

## 3.광고 요청&#x20;

{% code title="요청 객체 선언" lineNumbers="true" %}

```java
import com.mmc.man.view.AdManView;  
AdManView splashAd = new AdManView(Context c);
```

{% endcode %}

{% code title="요청 객체에 데이터 및 리스너 연결" lineNumbers="true" %}

```java
splashAd.setData(adData, new AdListener(){...});
```

{% endcode %}

* 광고 객체에 매체 광고 레이아웃 추가

{% code title="레이아웃 추가 메서드" lineNumbers="true" %}

```java
splashAd.addBannerView(splashArea);
```

{% endcode %}

* 최종 요청 메서드

{% code title="광고 요청 메서드" lineNumbers="true" %}

```java
splashAd.request(new Handler());
```

{% endcode %}

* 유저한테 안보이는 구간에서는 필히 리소스 해제 필요

{% code title="광고 리소스 해제 메서드" lineNumbers="true" %}

```java
if (splashAd != null) {    
    splashAd.onDestroy();
}
```

{% endcode %}

[좋아요](https://wiki.cjenm.com/pages/viewpage.action?pageId=188876422)처음으로 좋아하는 사람이 돼볼까요?


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.targetpick.io/targetpick_eng/android-sdk/splash.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
