03. SDK for Java

SDK Installation

You can configure the SDK using Gradle.

Maven Settings

Add the following Maven repository to the project-level build.gradle

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

Dependency Settings

Add the following dependency to the app-level build.gradle

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

Permission Settings

The following required permissions must be added to the Android Manifest:

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

ONE AdMax SDK

Media Key Registration

Add the media key issued from the ONE AdMax console within the application tag of the Android Manifest.

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

SDK Initialize

@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.");
            }
        });
    }
    ...
}

onDestroy() API

Release the resources (View, Memory) allocated in memory when the application is terminated. This should be called in the onDestroy() method of the activity that is being terminated.

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

Log Settings

You can enable or disable the logs for the ONE AdMax SDK.

ONEAdMax.setLogEnable( true ); // default false

GDPR Settings

To comply with the EU's GDPR (General Data Protection Regulation) regulation, the following API is used. It is called only for users who need to provide GDPR consent.

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

COPPA Settings

To comply with the COPPA (Children's Online Privacy Protection Rule), the following API is added. For devices that fall under COPPA, all types of ad requests will be treated as "No ad" (default: false).

ONEAdMaxClient.tagForChildDirectedTreatment(true);

Last updated