Digiteka allows you to integrate a single SDK into your app, and serve "outstream" video or display ads. Demo app includes the Digiteka SDK and is showing integration example.
NB: This procedure is valid while the SDK is not available on a private or public repo.
Integrate the SDK's AAR to the Android project.
1/ Add these lines into the root build.gradle :
buildscript {
ext.kotlin_version = "1.4.32"
[...]
dependencies {
[...]
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
[...]
}
}
allprojects {
repositories {
[...]
flatDir {
dirs 'libs'
}
}
}
2/ Add these lines into the module's build.gradle :
android {
[...]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
[...]
// SDK
implementation 'com.digiteka:outstream:release@aar'
// Required by Outstream SDK
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
[...]
}
3/ Add this permission into the manifest :
<uses-permission android:name="android.permission.INTERNET" />
Digiteka Outstream should be instantiated into the Application class of the project.
It is instantiated with the method init()
, with a given DTKConfig that includes :
Digiteka.init(
this, Digiteka.DTKConfig(
"<Your baseUrl>",
"<Your MDTK>"
)
)
The OutstreamView can be directly added into the XML layouts of the app.
<com.digiteka.oustream.OutstreamView
android:id="@+id/myAd"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
To initialize an OustreamView, the integrator must call the method initConfig()
of the view, giving the following configuration :
onClose()
of the webview to add more actions,val outstreamListener = object : OutstreamView.OutstreamViewListener {
override fun onClose() {
Toast.makeText(this@MainActivity, "OutstreamView closed", Toast.LENGTH_LONG).show();
}
}
val outstreamConfig = OutstreamView.OutstreamViewConfig(
"<Your URL Referrer>",
<Your Zone>,
outstreamViewListener = outstreamListener,
"<Your adUnit (optional)>"
)
// Configuration initialization
myAd.initConfig(outstreamConfig)
Loading a banner in the webview will always be triggered by the integrator, by the method load()
.
// Start loading
myAd.load()
Consent string can be force updated by giving it directly to the SDK :
Digiteka.getInstance().config.consentString =
"CO9E0YNO9Yz7EAHABAFRA0CsAP_AAH_AAAAAGYtf_X9fb2vj-_5999t0eY1f9_63v-wzjgeNs-8NyZ_X_L4Xr2MyvB34pq4KmR4Eu3LBAQdlHGHcTQmQwIkVqTLsak2Mq7NKJ7JEilMbM2dYGG1vn8XTuZCY70_sf__z_3-_-___67YGXkEmGpfAQJCWMBJNmlUKIEIVxIVAOACihGFo0sNCRwU7K4CPUACABAYgIwIgQYgoxZBAAAAAElEQAkAwIBEARAIAAQArQEIACJAEFgBIGAQACoGhYARRBKBIQZHBUcogQFSLRQTzRgAA"