Integrate the Device Data Collector into Native Java Android Applications using the Library JAR

Provide native support for your solution by integrating the Device Data Collector Android SDK into your native java Android application. This allows you to use our services without having to create API calls.

Integrating Android Library JAR

  1. Download the latest SDK from GitHub, and then extract the contents.

  2. In Android Studio, copy the JAR file into the libs folder “Project Path”\app\libs of your application. If you want to manually add the library to your application's build.gradle file, follow the steps in the code snippet below.

  3. In the Project viewer, right-click the JAR file, and then select Add as library.

  4. In your app build.gradle file, add the following dependencies:

          dependencies {
            ...
            // Kount SDK manually integration
            implementation fileTree(dir: "libs", include: ["kount-data-collector-5.x.x.jar"])
            
            // All these versions are minimums; you can update to newer ones.
            implementation "androidx.core:core-ktx:1.0.0"
            implementation "androidx.appcompat:appcompat:1.5.0"
            implementation "com.google.android.instantapps:instantapps:1.0.0"
            implementation "com.google.android.material:material:1.0.0"
            implementation "com.google.android.gms:play-services-base:7.0.0"
            implementation "com.google.code.gson:gson:2.8.9"
            implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.0"
            implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0"
      }
        

    Note

    The Kotlin library is only necessary if your application is written in Java. If your application uses Support libraries, then it must be migrated to Android X libraries. Refer to Migrate for Android X for steps on migrating to Android X libraries.

    If you get an error like unable to resolve dependency for compilepath: :app@debug/compileclasspath: Could not resolve, check that the source and target compatibility are set by adding the following lines of code in your application’s build.gradle:

    android {
        ...
        // Configure only for each module that uses Java 8 language features (either in its source code or through dependencies).
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_1_8
            targetCompatibility = JavaVersion.VERSION_1_8
        }
    }
  5. Once you have integrated the Library JAR, go to How to Invoke the Device Data Collector into Mobile Apps using the Native Android Java SDK to invoke your native Java Android app.

Was this article helpful?
0 out of 0 found this helpful