애드팝콘 SSP

Android 네이티브 광고 미디에이션 레이아웃 가이드 입니다.

AdPopcornSSP의 경우v3.1.9버전부터 직접 설정 이외에 템플릿 기능도 추가되었습니다.

이에 직접 설정 혹은 템플릿 사용 방식 중 하나를 선택해 사용하시기 바랍니다. 단, 템플릿 설정 시, 애드팝콘 사업팀(pm@adpopcorn.com)에 사용 문의를 먼저 해주시기 바랍니다.

1. 직접 설정

  • adpopcorn_native_ad_unit_layout.xml 샘플

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center"
    android:background="#FFFFFF">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="horizontal"
        android:background="#FFFFFF">
        <ImageView
            android:id="@+id/apssp_native_ad_icon_image1"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:layout_margin="10dp"/>
        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_gravity="center"
            android:orientation="vertical">
            <TextView
                android:id="@+id/apssp_native_ad_title1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#000000"/>
            <TextView
                android:id="@+id/apssp_native_ad_desc1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:textColor="#000000"/>
        </LinearLayout>
        <TextView
            android:id="@+id/apssp_native_ad_ctatext1"
            android:layout_width="60dp"
            android:layout_height="30dp"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:background="#3d7caf"
            android:textColor="#ffffff"
            android:textColorHint="#ffffff"
            android:gravity="center"
            android:textSize="16sp" />
    </LinearLayout>
    <ImageView
        android:id="@+id/apssp_native_ad_main_image1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>

xml에서 생성한 ui component를 sdk에서 제공하는 setAdPopcornSSPViewBinder API를 이용해 아래와 같이 설정해 줍니다.

2. 템플릿 사용

1) AdPopcornSSPNativeAdTemplate Layout

AdPopcornSSPNativeAd View 안에 AdPopcornSSPNativeAdTemplate 뷰를 추가해 줍니다.

2) Native Asset 연결

xml에 생성한 resource id를 setAdPopcornSSPViewBinder API를 이용하여 아래와 같은 방식으로 매칭합니다.

Last updated

Was this helpful?