03. SDK for Java

SDK Installation

gradle์„ ์ด์šฉํ•˜์—ฌ SDK ์„ค์ •์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

Maven Settings

ํ”„๋กœ์ ํŠธ ์ˆ˜์ค€ build.gradle์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด maven์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

repositories {
    google()
    mavenCentral()
 
    maven{
        url "https://repo.onestore.co.kr/repository/onestore-sdk-public"
    }
}

Dependency Settings

์•ฑ ์ˆ˜์ค€ build.gradle์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด dependency๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

dependencies {
    ...
    implementation 'com.oneadmax.sdk:sdk-ads:1.2.1'
    ...
}

ํ•„์ˆ˜ Permission ์„ค์ •

๋‹ค์Œ์˜ ํ•„์ˆ˜ ๊ถŒํ•œ์ด Android Manifest์— ์ถ”๊ฐ€๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

<manifest>
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
...
</manifest>

ONE AdMax SDK

๋งค์ฒดํ‚ค ๋“ฑ๋ก

Android Manifest์˜ application ํƒœ๊ทธ ๋‚ด์— ONE AdMax ์ฝ˜์†”์—์„œ ๋ฐœ๊ธ‰ ๋ฐ›์€ ๋งค์ฒด ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

<manifest>
    ...
    <application>  
        <meta-data android:name="com.oneadmax.global.appkey" android:value="your_app_key" />
    </application>
     ...
</manifest>

SDK ์ดˆ๊ธฐํ™”

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate( savedInstanceState );
    ...
     
    if( ONEAdMax.isInit( MyActivity.this ) == false ){
        ONEAdMax.init( MyActivity.this, new IOAMInitListener() {
            @Override
            public void onInitialized() {
                Log.d( Tag, "ONEAdMax SDK Initialized.");
            }
        });
    }
    ...
}

SDK ํ•ด์ œ

์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ข…๋ฃŒ๋  ๋•Œ ๋ฉ”๋ชจ๋ฆฌ์— ํ• ๋‹น๋œ ๋ฆฌ์†Œ์Šค( View, Memory )๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. ์•ฑ์ด ์ข…๋ฃŒ๋  ๋•Œ ํ˜ธ์ถœ๋˜๋Š” activity์˜ onDestroy()์—์„œ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

@Override
protected void onDestroy() {
    // TODO Auto-generated method stub 
    super.onDestroy();  
     
    ...
 
    ONEAdMax.unInit();
}

Log Settings

ONE AdMax SDK์˜ ๋กœ๊ทธ๋ฅผ ํ™œ์„ฑ ๋˜๋Š” ๋น„ํ™œ์„ฑํ™” ํ•ฉ๋‹ˆ๋‹ค.

ONEAdMax.setLogEnable( true ); // default false

GDPR Settings

EU์˜ GDPR (General Data protection Regulation) ๋ฒ•์•ˆ์— ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ์•„๋ž˜ API๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. GDPR ๋™์˜๊ฐ€ ํ•„์š”ํ•œ ์œ ์ €์— ํ•œํ•ด ๋‹ค์Œ API๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

ONEAdMax.gdprConsentAvailable( false ); // Default : true

COPPA Settings

COPPA(Children's Online Privacy Protection Rule)๋ฒ•์•ˆ์— ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ์•„๋ž˜ API๋ฅผ ์ถ”๊ฐ€ ํ•ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋””๋ฐ”์ด์Šค์—์„œ๋Š” ๋ชจ๋“  ๊ด‘๊ณ  ํƒ€์ž…์˜ ๊ด‘๊ณ  ์š”์ฒญ์— ๋Œ€ํ•ด No ad ์ฒ˜๋ฆฌ ๋ฉ๋‹ˆ๋‹ค. (๊ธฐ๋ณธ๊ฐ’: false)

ONEAdMaxClient.tagForChildDirectedTreatment(true);

Last updated