Integrate Your App with the Samsung Ads SDK

Before you begin using the Samsung Ads SDK, you must integrate your app. Do the following:

  1. Configure your app.
  2. Add dependencies to your project.
  3. Configure ProGuard.

Configure your app

Include the following in the top-level build.gradle file:

allprojects {
    repositories {
	    flatDir {
		    dirs 'libs'
		}
	}
}

Add dependencies

Add the following to the dependencies section of your application module in your build.gradle file for the Samsung Ads SDK, Google Play services ads (required when the app is downloaded and not running in the cloud gaming environment), Gson, view binding, and other dependencies:

compile(name: 'smas-x.x.x-release.aar', ext:'aar')
implementation 'com.google.android.gms:play-services-ads:16.0.0'
implementation 'com.google.code.gson:gson:2.9.0' 
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3'
buildFeatures {
    viewBinding = true
}

Enable Test Mode

If you’re using a test unit id, ensure that you call the below API before initializing the SDK.

TestSettingsManager.setTestModeEnabled(enabled)