Skip to content

Integration & builds

Integration

To integrate Switcloud into a payment application, developers simply need to include the switcloud-clt-kt package in their Android project. Hardware abstraction is automatically managed using a well-structured Gradle build variant system.

Repository

Our Android packages (AAR files) are hosted in a public Nexus repository.

To enable fetching of Switcloud packages and their dependencies, add the following Maven repository configuration to your project's settings.gradle.kts:

dependencyResolutionManagement {

    ...

    repositories {
        google()
        mavenCentral()

        maven {
            url = uri("https://nexus.switstack.io/repository/switstack-mvn")
        }
    }

    ...
}

Integrating Switcloud client into an app

To integrate the Switcloud client into your Android application, add the following line to the dependencies section of your build.gradle.kts file:

dependencies {
    ...

    implementation("io.switstack.switcloud:switcloud-clt-kt:x.y.z")

    ...
}

Builds

Dependencies

The switcloud-clt-kt package relies on the following components:

  • switcloud-api-kt for communication with the Switcloud server
  • switcloud-l2-kt for managing the terminal's EMV L2 stack
block-beta
columns 2
    a["switcloud-api-kt"]
    b["switcloud-l2-kt"]
    space
    space
    c["switcloud-clt-kt"]:2
    space
    space
    d["payment application"]:2

    a --> c
    b --> c
    c --> d

Transitive dependencies

This is where Switcloud simplifies development. Hardware and EMV L2 abstraction are handled seamlessly using Android build variants.

Note

See Android documentation about build-variants for more info.

This approach ensures that the correct version of switcloud-l2-kt, and if necessary, the appropriate moka variant, is automatically selected — removing the need for manual dependency management.

Hardware abstraction

To support different hardware platforms, define a hardware dimension in your build.gradle.kts file:

android {
    ...

    flavorDimensions += "hardware"

    productFlavors {

        create("cots") {
            dimension = "hardware"
        }

        create("ingenico") {
            dimension = "hardware"
        }

        create("sunmi") {
            dimension = "hardware"
        }
    }

    ...
}

This setup enables three separate builds, each targeting a specific hardware platform. Gradle will automatically resolve the appropriate flavor of switcloud-l2-kt from the repository.

EMV L2 selection

On COTS platforms, especially those using Switstack’s moka EMV L2 stack, you may need to select builds with specific kernel configurations. Additional product flavors can be defined as needed.

Note

Additionnal information about available moka builds and flavors will come in soon.