스플래시
스플래시 화면에 광고 적용을 하기 위한 가이드 입니다.
1.매체 광고 레이아웃
XML
<RelativeLayout
android:layout_gravity="bottom"
android:id="@+id/splashArea"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="horizontal" >
</RelativeLayout>
Code
ViewGroup splashArea = findViewById(R.id.splashArea);
2.광고 데이터
import com.mmc.man.data.AdData;
AdData adData = new AdData();
adData.major(id, apiMode, publisher, media, section, storeUrl, appId, appName, adWidth, adHeight);
parameter
type
contents
etc
id
string
매체에서 사용할 광고 영역의 고유 id
apiMode
string
광고 타입 : AdConfig.API_INTER
publisher
int
퍼블리셔 코드
media
int
미디어 코드
section
int
섹션 코드
storeUrl
string
스토어 url
appId
string
패키지명
appName
string
앱 명
adWidth
int
노출되는 광고 영역 넓이 사이즈
adHeight
int
노출되는 광고 영역 높이 사이즈
adData.setUserAgeLevel(0);
value
type
contents
etc
0
int
어린이 (만13세 미만)
1
int
청소년, 성인 (만13세 이상)
-1
int
알 수 없음
adData.isPermission(AdConfig.NOT_USED);
value
type
contents
etc
AdConfig.USED
String
사용
AdConfig.NOT_USED
String
미사용
3.광고 요청
import com.mmc.man.view.AdManView;
AdManView splashAd = new AdManView(Context c);
splashAd.setData(adData, new AdListener(){...});
광고 객체에 매체 광고 레이아웃 추가
splashAd.addBannerView(splashArea);
최종 요청 메서드
splashAd.request(new Handler());
유저한테 안보이는 구간에서는 필히 리소스 해제 필요
if (splashAd != null) {
splashAd.onDestroy();
}
좋아요처음으로 좋아하는 사람이 돼볼까요?
Last updated