Set up Android SDK versions

United States
Canada
Europe
Latin America

In the Clover device, your Android app's SDK version definition needs to be evaluated and tested to ensure device compatibility.

Minimum SDK

The minimum SDK version (minSdkVersion) is the earliest release of the Android SDK that your application can run on. To ensure your app can be installed on all Clover devices, set the app's minimum SDK to 17. To allow your app to be available on specific Clover devices, set the minSdkVersion of your app according to the following table.

Clover deviceSDK version for specific devices
Station17

Note: Use this version to allow your app to be installed on any Clover device.
Mini

Mobile
19
Flex21
Station (2018)25
Flex (2nd Generation)

Mini (2018 LTE)

WIFI Mini (2021)

Clover Station

Clover Station Duo
27
Flex 3

Mini 3

Clover Station Duo 2

Clover Station Solo
29

Target SDK

The target SDK version (targetSdkVersion) informs Android which compatibility layers it must enable to ensure your app runs correctly. The target SDK version should be set to the highest API level that you have tested with your app.

If you set your target SDK to a value greater than what you have tested, Android may disable a compatibility layer on which your app depends. This is mostly to indicate how current your application is, for example, for use in the marketplace.

Compile SDK

The compile SDK version (compileSdkVersion) is the version of Android your IDE uses to compile your app when you publish an .apk file. Set the compile SDK to the highest API level that Google has made available, as listed on (https://developer.android.com/studio/releases/platforms). Use the highest available level to ensure that all software libraries your project uses compile successfully.

The actual APIs that can be used at runtime are determined by the API level of the device upon which your app is running. For example, if a class or method was added to the Android SDK in API level 25, the device must be running an operating system that implements API level 25 for that API to be available. Attempting to use APIs that are greater than what the current device offers will fail. See https://developer.android.com/training/basics/supporting-devices/platforms for more information.

🚧

IMPORTANT

Clover supports apps with target SDK level 25 or lower. With SDK level 27, Android introduced the account access and discoverability policy, which explicitly requests access to Clover merchant accounts and disrupts the expected merchant flow.

To have your apps functioning correctly and be approved for publication on the Clover App Market, set the targetSdkVersion value to 25 or lower.

If you are using Android Studio to generate a signed APK for your app, you may receive an error message like

Error: Google Play requires that apps target API level 29 or higher. [ExpiredTargetSdkVersion]

To suppress this error, add the following code above the targetSdkVersion line in your app's build.gradle file:

// noinspection ExpiredTargetSDKVersion

Set the target SDK on an emulator

If you develop on an emulator, set the target SDK version to the highest API level virtual machine on which you have tested. For a more detailed description of target SDKs, refer to the Android Developer documentation.

For each SDK level you want to support, review the Android behavior changes, code with the changes in mind, and test your app against them.

Example build files

Suppose you are developing an app for Station 2018. That device's runtime is 25, so you must test your code against that version. Note that the compile SDK can be higher than the runtime API level.

Your app's build.gradle file would need to include the following:

android {
  compileSdkVersion 31 // Update to a higher level if/when compilation fails with minCompileSdk error
  ...
  defaultConfig {
    minSdkVersion 17 //required minimum SDK for Clover apps
    targetSdkVersion 25 //API level used for testing
    ...
  }
  ...
}