Configure Android

OpenWeb Native View Configuration

  1. From within Android Studio, open your app.
  2. In the project build.gradle file, add the JitPack repository.
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

  1. In the app build.gradle file, add the androidx.multidex:multidex:2.0.1 dependency.
dependencies {
    ...
    implementation 'androidx.multidex:multidex:2.0.1'
}



  1. Also in the app build.gradle file, set minSdkVersion to 19 or greater. If you set minSdkVersion to 19 - 20, you must also set multiDexEnabled true.
android {
    defaultConfig {
        ...
        minSdkVersion 19
        multiDexEnabled true
    }



  1. Apply Spot.IM gradle plugin. You can use one of the following options to apply the plugin.
Option Steps
Option 1: Use the plugins DSL In the app build.gradle file add id "im.spot" version "1.0" in the plugins section.


Code example
plugins {
    id "im.spot" version "1.0"
}
Option 2: Use legacy plugin application 1. In the project build.gradle file, add the gradle plugins repository https://plugins.gradle.org/m2/ and the OpenWeb plugin dependency gradle.plugin.im.spot:spotim-gradle-plugin:1.0

2. In the app build.gradle file, apply the im.spot plugin.


Code example: project build.gradle
buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "gradle.plugin.im.spot:spotim-gradle-plugin:1.0"
    }
}

Code example: app build.gradle
apply plugin: "im.spot"

🚧

Note

Make sure to apply the plugin after the com.android.application plugin.



  1. In the AndroidManifest.xml file, add the permission to use the Internet: <uses-permission android:name="android.permission.INTERNET" />.



Did this page help you?