Android SDK Guide
The current version is 200.
Ad type
division | Sample | Explanation |
---|---|---|
banner | This is a general bar-shaped banner. Most of them are located at the bottom, but depending on the publisher’s adjustments, they can also appear at the top or middle. |
|
Front banner | When the app is launched, an ad is displayed in the foreground, and the surface area can be adjusted according to the publisher’s adjustment. | |
Full video banner | When running the app, an interstitial video ad is posted. | |
End (ending) banner | When the app is terminated, an advertisement is displayed on the front side, and a dialog to confirm whether the app is terminated is displayed at the bottom of the advertisement. | |
video | This is a video advertisement that is played in Pre-Roll format before video content is played. | |
Front extension | When the app is launched, an interstitial ad is posted, and the remaining area is filled with a color of 1 pixel at the top left. | |
Native feed | It is an advertisement made of various elements (assets). Ads are posted on the front, Videos and images are included. Publishers can post advertisement forms by combining each element (asset) (inquire separately). |
|
Native feed banner | It is an advertisement made of various elements (assets). Advertising is posted in the form of a bar, Videos and images are included. Publishers can post advertisement forms by combining each element (asset) (inquire separately). |
|
Video end card | - | This is an advertising product in which an image or rich media type of creative is exposed in the relevant area after the video ad ends. |
Playable (MRAID) | - | It is an advertisement product that can implement and expose various types of materials (animation, interactive, etc.) using the MRAID standard. |
Supported product (size)
Product classification | size |
---|---|
banner | 300x50 ㅣ 320x50 ㅣ 320x100 ㅣ 640x240 ㅣ 640x100 ㅣ 728x90 |
Front banner | 640x960 ㅣ 320X480 ㅣ 480x320 ㅣ 1024x768 ㅣ 750x1200 ㅣ 768x1024 |
End banner | 640x960 ㅣ 750x1200 |
Square and rectangle | 200x200 ㅣ 240x400 ㅣ 240x240 ㅣ 250x250 ㅣ 250x360 ㅣ 300x250 ㅣ 336x280 ㅣ 150x150 ㅣ 580x400 |
Skyscraper | 120x600 ㅣ 160x600 ㅣ 300x600 ㅣ 300x1050 |
Leaderboard | 468x60 ㅣ 728x90 ㅣ 930x180 ㅣ 970x90 ㅣ 970x250 ㅣ 980x120 |
Native feed | 640x960 |
Native feed banner | 320x100 ㅣ 320x50 |
Video end card | - |
Playable (MRAID) | 320x100 ㅣ 320x50 ㅣ 640x960 |
SDK library applied
Environment settings required for Android development are omitted from the paper.
Create Android Project to be developed.
Create a libs folder and add the provided adMan.jar.
AndroidManifest.xml
android.permission is the permission setting required for ad insertion of the Ad SDK.
You must insert android:configChanges=”orientation|keyboard” in the attribute of the activity where you want to insert ads.
(To prevent waste of network resources due to continuous OnCreate calls)
From android9 (API 28), a value (android:usesCleartextTraffic=”true”) is inserted into the application due to the strengthened network security policy.
Advertisement image url load, tracking element, resource can be composed of http, so insert the appropriate option.
If the app to which the Ad SDK applies targets android11 (API Level 30) or higher, and you need to interact with an app other than the automatically displayed app, you need to add an element to the app’s manifest file.
Since our ad SDK uses Google Chrome by default when clicking an ad, a manifest file must be created as shown in the example below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mezzomedia.sampleapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="30" />
<!--Network usage -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--Terminal information (TelephonyManager's MNC, MCC) use -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!--use chrome browser-->
<queries>
<package android:name="com.android.chrome"/>
</queries>
<!--Advertisement image url load, tracking element, resource can be composed of http, so insert the corresponding option(android:usesCleartextTraffic="true") -->
<application
android:usesCleartextTraffic="true"
android:name=".MZApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Java source
Banner
private AdManView bannerView = null;
public void onDestoryBanner(final Context c) {
if (bannerView != null) {
bannerView.onDestroy();
}
}
//Sample source Navimanager.java
public void requestBanner(final Context c, final int p, final int m, final int s, final ViewGroup bannerArea) {
AdData adData = new AdData(); //Data organization class in ad settings
String appName = "appname";
//Required ad settings
adData.major("testbanner", AdConfig.API_BANNER, p, m, s, "http://www.storeurl.com", "packagename", appName, 320, 50);
//User age level required
adData.setUserAgeLevel(0);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
//When using API MODE, only communication is handled, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/).
adData.setApiModule(AdConfig.NOT_USED, AdConfig.NOT_USED);
bannerView = new AdManView(c);
bannerView.addBannerView(bannerArea);
bannerView.setData(adData, new AdListener() {
//Ad call success
@Override
public void onAdSuccessCode(Object v, String id, final String type, final String status, final String jsonDataString) {
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
//When using API MODE, the area used for communication is removed.
if(AdConfig.USED.equals(adData.getApiModule())){
Toast.makeText(c, jsonDataString, Toast.LENGTH_SHORT).show();
MzLog.e("apimodeJson : "+jsonDataString);
}else{
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if (AdResponseCode.Status.SUCCESS.equals(status)) {
bannerView.addBannerView(bannerArea);
}
}
});
}
}
});
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
onDestoryBanner(c);
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
onDestoryBanner(c);
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
onDestoryBanner(c);
}else if(AdEvent.Type.CLOSE.equals(type)){
onDestoryBanner(c);
}else if(AdEvent.Type.IMP.equals(type)){
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
bannerView.request(new Handler());
}
Inter Banner
InLayout
Inlayout is a way to put an interstitial ad in the area, and you can use the options below.
adData.setIsInLayout(AdConfig.USED);
private AdManView inlayoutInter = null;
public void destroyInter() {
if (inlayoutInter != null) {
inlayoutInter.onDestroy();
inlayoutInter = null;
}
}
//Sample source Navimanager.java
public void requestInlayoutInter(final Context c, final int p, final int m, final int s, final RelativeLayout bannerArea) {
AdData adData = new AdData();//Data organization class in ad settings
String appName = "appname";
//Required ad settings
adData.major("testInter", AdConfig.API_INTER, p, m, s, "http://www.storeurl.com", "packagename", appName, 320, 480);
//User age level required
adData.setUserAgeLevel(0);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
//When using API MODE, only communication is handled, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/).
adData.setApiModule(AdConfig.NOT_USED, AdConfig.NOT_USED);
//Method used to add an interstitial ad to a specific layout
adData.setIsInLayout(AdConfig.USED);
inlayoutInter = new AdManView(c);
inlayoutInter.setData(adData, new AdListener() {
//Ad call success
@Override
public void onAdSuccessCode(Object v, String id, final String type, final String status, final String jsonDataString) {
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if(AdConfig.USED.equals(adData.getApiModule())){
Toast.makeText(c, jsonDataString, Toast.LENGTH_SHORT).show();
MzLog.e("apimodeJson : "+jsonDataString);
}else{
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if (AdResponseCode.Status.SUCCESS.equals(status)) {
inlayoutInter.addBannerView(bannerArea);
}
}
});
}
}
});
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
destroyInter();
}else if(AdEvent.Type.CLOSE.equals(type)){
destroyInter();
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
inlayoutInter.request(new Handler());
}
Inter (Popup)
The popup of outlayout is a way to show the interstitial advertisement as a popup.
adData.setIsInLayout(AdConfig.NOT_USED);
adData.setPopup(AdConfig.USED);
private AdManPage adManInterActivity = null;
public void destroyInter() {
if (adManInterActivity != null) {
adManInterActivity.onDestroy();
adManInterActivity = null;
}
}
//Sample source Navimanager.java
public void requestInter(final Context c, final int p, final int m, final int s) {
AdData adData = new AdData();
String appName = "appname";
adData.major("testInter", AdConfig.API_INTER, p, m, s, "http://www.storeurl.com", "packagename", appName, 0, 0);
//User age level required
adData.setUserAgeLevel(0);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
//Whether to use pop-ups
adData.setPopup(AdConfig.USED);
//Whether to put in a specific view
adData.setIsInLayout(AdConfig.NOT_USED);
//When using API MODE, only communication is handled, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/).
adData.setApiModule(AdConfig.NOT_USED, AdConfig.NOT_USED);
adManInterActivity = new AdManPage(c);
adManInterActivity.setData(adData, new AdListener() {
//Ad call success
@Override
public void onAdSuccessCode(Object v, String id, String type, String status, String jsonDataString) {
if(AdConfig.USED.equals(adData.getApiModule())){
Toast.makeText(c, jsonDataString, Toast.LENGTH_SHORT).show();
MzLog.e("apimodeJson : "+jsonDataString);
}
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
destroyInter();
}else if(AdEvent.Type.CLOSE.equals(type)){
destroyInter();
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
adManInterActivity.request(new Handler());
}
Inter (Full Screen)
The full screen of outlayout is a way to show the interstitial advertisement in full screen. adData.setIsInLayout(AdConfig.NOT_USED); You can use the adData.setPopup(AdConfig.NOT_USED); method.
private AdManPage adManInterActivity = null;
public void destroyInter() {
if (adManInterActivity != null) {
adManInterActivity.onDestroy();
adManInterActivity = null;
}
}
//Sample source Navimanager.java
public void requestInter(final Context c, final int p, final int m, final int s) {
AdData adData = new AdData();
String appName = "appname";
adData.major("testInter", AdConfig.API_INTER, p, m, s, "http://www.storeurl.com", "packagename", appName, 0, 0);
//User age level required
adData.setUserAgeLevel(0);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
//Whether to use pop-ups
adData.setPopup(AdConfig.NOT_USED);
//Whether to put in a specific view
adData.setIsInLayout(AdConfig.NOT_USED);
//When using API MODE, only communication is handled, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/).
adData.setApiModule(AdConfig.NOT_USED, AdConfig.NOT_USED);
adManInterActivity = new AdManPage(c);
adManInterActivity.setData(adData, new AdListener() {
//Ad call success
@Override
public void onAdSuccessCode(Object v, String id, String type, String status, String jsonDataString) {
if(AdConfig.USED.equals(adData.getApiModule())){
Toast.makeText(c, jsonDataString, Toast.LENGTH_SHORT).show();
MzLog.e("apimodeJson : "+jsonDataString);
}
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
destroyInter();
}else if(AdEvent.Type.CLOSE.equals(type)){
destroyInter();
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
adManInterActivity.request(new Handler());
}
Ending Banner
private AdManView adManEnding = null;
public void destroyEnding() {
if(adManEnding != null){
adManEnding.onDestroy();
}
//Remove ui used for ending banner
}
public void requestEnding(final Context c, final int p, final int m, final int s, final int w, final int h) {
AdData adData = new AdData();
String appName = "appname";
int width = w;//(int) MZDisplayUtil.convertPixelsToDp(c, h); This is a method in the sample app. Please do not use it.
int height = h;//(int) MZDisplayUtil.convertPixelsToDp(c, h); This is a method in the sample app. Please do not use it.
adData.major("testInter", AdConfig.API_ENDINNG, p, m, s, "http://www.storeurl.com", "packagename", appName, width, height);
//User age level required
adData.setUserAgeLevel(0);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
//When using API MODE, only communication is handled, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/).
adData.setApiModule(AdConfig.NOT_USED, AdConfig.NOT_USED);
adManEnding = new AdManView(c);
adManEnding.setData(adData, new AdListener() {
@Override
public void onAdSuccessCode(Object v, String id, final String type, final String status, final String jsonDataString) {
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if(AdConfig.USED.equals(adData.getApiModule())){
Toast.makeText(c, jsonDataString, Toast.LENGTH_SHORT).show();
MzLog.e("apimodeJson : "+jsonDataString);
}else{
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if (AdResponseCode.Status.SUCCESS.equals(status)) {
showEndingBanner(c, w, h);
}
}
});
}
}
});
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
destroyEnding();
}else if(AdEvent.Type.CLOSE.equals(type)){
destroyEnding();
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
adManEnding.request(new Handler());
}
Movie
public void requestMovie(final Context c, final int p, final int m, final int s, final RelativeLayout bannerArea, final int w, final int h, String autoPlay, final String autoReplay, String clickFullArea, String muted, String soundBtnShow, String clickBtnShow, String skipBtnShow, String showClose) {
AdData adData = new AdData();
String appName = "appname";
int width = w;//(int) MZDisplayUtil.convertPixelsToDp(c, h); This is a method in the sample app. Please do not use it.
int height = h;//(int) MZDisplayUtil.convertPixelsToDp(c, h); This is a method in the sample app. Please do not use it.
adData.major("movie", AdConfig.API_MOVIE, p, m, s, "http://www.storeurl.com", "packagename" appName, width, height);
//User age level required
adData.setUserAgeLevel(0);
//Movie ad settings
adData.movie(autoPlay, autoReplay, clickFullArea, muted, soundBtnShow, clickBtnShow, skipBtnShow);
//Whether to use the close button
adData.setIsCloseShow(showClose);
//Whether to use permission
adData.isPermission(AdConfig.NOT_USED, AdConfig.NOT_USED);
final AdManView movieView = new AdManView(c);
movieView.setData(adData, new AdListener() {
@Override
public void onAdSuccessCode(Object v, String id, final String type, final String status, String jsonDataString) {
((Activity) c).runOnUiThread(new Runnable() {
@Override
public void run() {
if (AdResponseCode.Status.SUCCESS.equals(status)) {
movieView.addBannerView(bannerArea);
}
}
});
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
if(movieView!=null){
movieView.onDestroy();
}
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
if(movieView!=null){
movieView.onDestroy();
}
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
if(movieView!=null){
movieView.onDestroy();
}
bannerArea.removeAllViews();
}else if(AdEvent.Type.CLOSE.equals(type)){
if(movieView!=null){
movieView.onDestroy();
}
bannerArea.removeAllViews();
}else if(AdEvent.Type.SKIP.equals(type)){
}else if(AdEvent.Type.ENDED.equals(type)){
if(movieView!=null){
movieView.onDestroy();
}
bannerArea.removeAllViews();
}else if(AdEvent.Type.IMP.equals(type)){
}else if(AdEvent.Type.START.equals(type)){
}else if(AdEvent.Type.FIRSTQ.equals(type)){
}else if(AdEvent.Type.MIDQ.equals(type)){
}else if(AdEvent.Type.THIRDQ.equals(type)){
}else if(AdEvent.Type.COMPLETE.equals(type)){
}
}
// Ad permission (location) setting request event-This is an event to receive app permission on the user terminal setting page.
@Override
public void onPermissionSetting(Object v, String id) {
// If the isPermission value is set to unused, no event occurs.
}
});
//Request method
movieView.request(new Handler());
}
Common
Method - This method is used when linking advertisements.
method | Explanation |
---|---|
AdManView ( Context context ) | Ad Creator (Used except for front pop-ups.) |
AdManPage ( Context context ) | Advertisement Creator (Use when viewed as a front popup) |
setData ( AdData adData, AdListener adListener ) | Ad setting method |
request( Handler handler ) | Start advertising logic |
onDestroy( ) | End of advertising logic |
addBannerView(ViewGroup bannerArea) | Method of placing advertisement in a specific area |
AdData - This is the data used to insert ads.
method | Explanation | Usable range |
---|---|---|
major(String id, String apiMode, int publisher, int media, int section, String storeUrl, String appId, String appName, int adAreaWidth, int adAreaHeight ) |
Required value setting method | common |
setUserAgeLevel(int userAgeLevel) | required Value User’s Age Level | common |
movie(String autoPlay, String autoReplay, String clickFullArea, String muted, String soundBtnShow, String clickBtnShow, String skipBtnShow) |
Option value setting method | movie |
isPermission(String isLocation, String isReadPhone) | Whether to use permission (AdConfig.NOT_USED, AdConfig.USED) |
common |
setApiModule(String isApimode, String isAsset) | Direct user control of api response (AdConfig.NOT_USED, AdConfig.USED) When using API MODE, only communication is processed, and responses must be processed separately. Please refer to the guide page (http://docs.meba.kr/s-plus/api/base/delivery/) |
Exclude video |
setKeyword(String keyword) | Passing the keyword value Use the separator as ^ Encode the keyword value |
common |
setExternal(String external) | When using extended parameters (Guide must be obtained when using additional parameters.) | 공통 |
setIsInLayout(String isInLayout) | Whether to use insert specific layout (AdConfig.NOT_USED, AdConfig.USED) |
Front |
setPopup(String isPopup) | Whether to use pop-up style (AdConfig.NOT_USED, AdConfig.USED) |
Front |
setBackgroundColor(String color) | popup background color (default : #88000000) |
Front |
setAutoFinish(String autoFinish) | Automatic shutdown on click (AdConfig.NOT_USED, AdConfig.USED[default]) |
Front |
setDefaultBackgroundColor(String color) | ad background color (default : #000000) |
common |
setIsCloseShow(String isCloseShow) | Whether to use close button (AdConfig.NOT_USED, AdConfig.USED) |
video |
major - Required value setting method
Factor value | Explanation |
---|---|
String id | Unique ID of the ad area to be used by the media ex) bannerid, interbannerid |
String apiMode | Ad type |
int publisher | Publisher code |
int media | Media code |
int section | Section code |
String storeUrl | Store url |
String appId | Package name |
String appName | App name |
int adAreaWidth | The size of the advertising area to be exposed |
int adAreaHeight | Ad area size height exposed |
ageLevel - user’s age level
constant | Explanation |
---|---|
0 | Child (under 13 years old) |
1 | Youth, Adult (13 years old or older) |
-1 | unknown |
movie - Option value setting method
Factor value | Explanation |
---|---|
String autoPlay | 자동 플레이 (AdConfig.NOT_USED, AdConfig.USED) |
String autoReplay | 자동 리플레이 설정 (AdConfig.NOT_USED, AdConfig.USED) |
String clickFullArea | 화면 전체 클릭 설정 여부 (AdConfig.NOT_USED, AdConfig.USED) |
String muted | 음소거로 시작할지 여부 (AdConfig.NOT_USED, AdConfig.USED) |
String soundBtnShow | 음소거 버튼 노출 여부 (AdConfig.NOT_USED, AdConfig.USED) |
String clickBtnShow | 광고더보기버튼 노출 여부 (AdConfig.NOT_USED, AdConfig.USED) |
String skipBtnShow | 스킵버튼 노출 여부 (AdConfig.NOT_USED, AdConfig.USED) |
AdConfig - This is the value used for ad settings.
constant | Explanation |
---|---|
AdConfig.SDK_VERSION | sdk version |
AdConfig.SDK_RELEASEDATE | sdk release date |
AdConfig.API_BANNER | apiModeValue passed to: banner |
AdConfig.API_INTER | apiModeValue passed to: Front banner |
AdConfig.API_ENDING | apiModeValue passed to: End banner |
AdConfig.API_MOVIE | apiModeValue passed to: Video advertisement |
AdConfig.USED | isPermission, setIsInLayout, setIsCloseShow, setPopup Value set in the use of method such as |
AdConfig.NOT_USED | isPermission, setIsInLayout, setIsCloseShow, setPopup Value set in the use of method such as |
How to use AdListener
//Ad call success
@Override
public void onAdSuccessCode(Object v, String id, final String type, final String status, final String jsonDataString) {
if(AdResponseCode.Type.HOUSE.equals(type)){
//Ad Success: Free
}else{
//Advertising success: paid
}
}
//Ad call failure error
@Override
public void onAdFailCode(Object v, String id, String type, String status, String jsonDataString) {
if(AdResponseCode.Status.NOAD.equals(status)){
//Advertisement
}else if(AdResponseCode.Status.TIMEOUT.equals(status)){
//Network timeout
}else if(AdResponseCode.Status.ERROR_PARSING.equals(status)){
//Parsing error
}else if(AdResponseCode.Status.DUPLICATIONCALL.equals(status)){
//Duplicate call
}else if(AdResponseCode.Status.ERROR.equals(status)){
//Exceptional error
}else if(AdResponseCode.Status.ERROR_NOTSUPPORT_BROWSER.equals(status)){
//Not supported Browser
}else if(AdResponseCode.Status.ERROR_NOTSUPPORT_IOS.equals(status)){
//Not supported Ios version
}else if(AdResponseCode.Status.ERROR_NOTSUPPORT_ANDROID.equals(status)){
//Not supported Android version
}else if(AdResponseCode.Status.NEEDSYNC.equals(status)){
//ajax error
}else if(AdResponseCode.Status.DEVICE_NETWORK_ERROR.equals(status)){
//Terminal network status error
}else if(AdResponseCode.Status.DEVICE_RENDERING_TIMEOUT.equals(status)){
//Ad rendering timeout
}else if(AdResponseCode.Status.DEVICE_SETTING_ERROR.equals(status)){
//Ad data incorrect setting error
}else if(AdResponseCode.Status.DEVICE_AD_INTERVAL.equals(status)){
//Call error within the set time after ad call
}else if(AdResponseCode.Status.APP_LIFECYCLE_BACK.equals(status)){
//Errors that occur when calling the background
}
}
//Advertisement call failure error (webview error)
@Override
public void onAdErrorCode(Object v, String id, String type, String status, String failingUrl) {
int errorCode = Integer.valueOf(type);
switch (errorCode) {
case WebViewClient.ERROR_AUTHENTICATION:
//User authentication failure on server
break;
case WebViewClient.ERROR_BAD_URL:
//Invalid URL
break;
case WebViewClient.ERROR_CONNECT:
//Failed to connect to server
break;
case WebViewClient.ERROR_FAILED_SSL_HANDSHAKE:
//Failure to perform SSL handshake
break;
case WebViewClient.ERROR_FILE:
//Generic file error
break;
case WebViewClient.ERROR_FILE_NOT_FOUND:
//File not found
break;
case WebViewClient.ERROR_HOST_LOOKUP:
//Server or proxy host name lookup failure
break;
case WebViewClient.ERROR_IO:
//Failure to read from or write to server
break;
case WebViewClient.ERROR_PROXY_AUTHENTICATION:
//User authentication failure at proxy
break;
case WebViewClient.ERROR_REDIRECT_LOOP:
//Too many redirects
break;
case WebViewClient.ERROR_TIMEOUT:
//Connection timeout
break;
case WebViewClient.ERROR_TOO_MANY_REQUESTS:
//Too many requests during page loading
break;
case WebViewClient.ERROR_UNKNOWN:
//General error
break;
case WebViewClient.ERROR_UNSUPPORTED_AUTH_SCHEME:
//Authentication scheme not supported
break;
case WebViewClient.ERROR_UNSUPPORTED_SCHEME:
//How the URI is not supported
break;
}
}
//Events triggered by ads
@Override
public void onAdEvent(Object v, String id, String type, String status, String jsonDataString) {
if(AdEvent.Type.CLICK.equals(type)){
//Ad click event
}else if(AdEvent.Type.CLOSE.equals(type)){
//Ad Close Event
}else if(AdEvent.Type.COMPLETE.equals(type)){
//Video q5 event
}else if(AdEvent.Type.IMP.equals(type)){
//Video exposure tracking
}else if(AdEvent.Type.SKIP.equals(type)){
//Video skip event
}else if(AdEvent.Type.START.equals(type)){
//Video q1 event
}else if(AdEvent.Type.FIRSTQ.equals(type)){
//Video q2 event
}else if(AdEvent.Type.MIDQ.equals(type)){
//Video q3 event
}else if(AdEvent.Type.THIRDQ.equals(type)){
//Video q4 event
}else if(AdEvent.Type.OBJSHOW.equals(type)){
//not used
}else if(AdEvent.Type.OBJHIDE.equals(type)){
//not used
}else if(AdEvent.Type.ENDED.equals(type)){
//Video ad termination
}
}
AdListener Explanation
method | Explanation |
---|---|
onAdSuccessCode(Object v, String id, String type, String status, String jsonDataString) | Ad success event |
onAdFailCode(Object v, String id, String type, String status, String jsonDataString) | Event that occurs when an error occurs |
onAdErrorCode(Object v, String id, String type, String status, String failingUrl) | Web view area event where advertisement is displayed ( WebViewClient Reference ) |
onAdEvent(Object v, String id, String type, String status, String jsonDataString) | Events happening in advertising |
Success type Code
Type | Explanation |
---|---|
AdResponseCode.Type.HOUSE | Free advertising |
AdResponseCode.Type.GUARANTEE | Paid advertising |
onAdFailCode status Code
Status | Explanation |
---|---|
AdResponseCode.Status.SUCCESS | success |
AdResponseCode.Status.NOAD | Ads for that ID do not exist |
AdResponseCode.Status.NEEDSYNC | ajax error |
AdResponseCode.Status.TIMEOUT | timeout |
AdResponseCode.Status.ERROR_PARSING | parsing error |
AdResponseCode.Status.DUPLICATIONCALL | duplicate call |
AdResponseCode.Status.ERROR | Exceptional error |
AdResponseCode.Status.ERROR_NOTSUPPORT_BROWSER | Unsupported browser |
AdResponseCode.Status.ERROR_NOTSUPPORT_IOS | Unsupported iOS version |
AdResponseCode.Status.ERROR_NOTSUPPORT_ANDROID | Unsupported Android version |
AdResponseCode.Status.DEVICE_NETWORK_ERROR | network error |
AdResponseCode.Status.DEVICE_RENDERING_TIMEOUT | Ad rendering timeout |
AdResponseCode.Status.DEVICE_SETTING_ERROR | Ad data incorrect setting error |
AdResponseCode.Status.DEVICE_AD_INTERVAL | Call error within the set time after ad call |
AdResponseCode.Status.APP_LIFECYCLE_BACK | Errors that occur when calling the background |
onAdEvent type Code
Status | Explanation |
---|---|
AdEvent.Type.CLICK | ad click |
AdEvent.Type.CLOSE | Ad Close Event |
AdEvent.Type.IMP | Video exposure event |
AdEvent.Type.SKIP | Video skip event |
AdEvent.Type.START | Video q1 event |
AdEvent.Type.FIRSTQ | Video q2 event |
AdEvent.Type.MIDQ | Video q3 event |
AdEvent.Type.THIRDQ | Video q4 event |
AdEvent.Type.COMPLETE | Video q5 event |
AdEvent.Type.ENDED | Video ended event |
Q&A
check whether an ad is exposed successfully
No | Description |
---|---|
1 | Q. How to check if an advertisement is not exposed after applying SDK A. SDK can be implemented in XML and Java code, so you can check whether the correct code is set in the way it is implemented. |
2 | Q. If there are no ads or free ads after the set of commercial advertisement A. The error of advertising exposure after you set up an ad is largely due to the incorrect code or to the test code. Please check the setting. If you are unable to see the commercial advertisement continuously, Please contact us. |
handling No ad (passback)
No | Description |
---|---|
1 | Q. No ad handling questions A. If the ad assigned to that ID does not exist or runs out of stock, or depending on time, application type, category, and date, the number of ads that can also be exposed may vary After a certain period of time, you can request an advertisement again or proceed to the next progressive logic in the part where you received the callback. |
2 | Q. Why do I see the figures in the report even in the No ad situation? A. Even under No ad, the report number is normal, which is the call number for inventory check, not for actual exposure. |
Contact
Division | Team | Name | Contact | |
---|---|---|---|---|
affiliated inquiry | Mobile AD Sales Team | JeongHyeok Kim | jeonghyeok.kim@cj.net | +82) 2-6484-3856 |
ID issue and ad setting | Mobile AD Sales Team | SunMin Lee | sunmin.lee1@cj.net | +82) 2-6484-3461 |