Android
App prerequisites
Make sure that your app's build file uses the following values:
- Minimum SDK version of
21or higher - Compile SDK version of
35or higher
Configure your app
In your Gradle settings file, include the Google's Maven repository and Maven central repository:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include(":app")Add the SDK dependency
Add the following dependency to your project’s build.gradle file:
implementation 'com.bidease:bidease-mobile:1.4.3'⚠️ Make sure to always use the latest available SDK versions from Bidease.
Remove optional or ad network–specific permissions (optional)
To exclude certain permissions (for example, those added by other ad networks), modify your AndroidManifest.xmlas shown below:
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>Initialization
Add the following Bidease SDK initialization code inside the onCreate() method of your main Activity:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
CoroutineScope(Dispatchers.Main).launch {
when (val initResult = BideaseMobile.init(applicationContext)) {
is InitSuccess -> {
// implement your logic, print or send logs, save app state or something
}
is InitFailure -> {
// handle error and dont try load and show ads
}
}
}
}
override fun onDestroy() {
super.onDestroy()
BideaseMobile.onDestroy()
}
}Updated 5 days ago