Set up Android SDK versions

United States
Canada
Europe
Latin America

In the Clover device, you need to evaluate and test your Android app's SDK version 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.

  • For your app to be installed on all Clover devices, set the app's minimum SDK to 17.
  • For specific Clover devices, set the minSdkVersion of your app based on the following table:
Clover deviceSDK version for specific devices
Station17; 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

Android uses the target SDK version targetSdkVersion to determine which compatibility layers to enable for your app to run correctly.

Set targetSdkVersion to the highest API level you have tested with your app. If you set it higher than the tested level, Android may deactivate a compatibility layer on which your app depends. This setting mainly indicates how current your application is, such as for use in the Clover App Market.

Troubleshoot issues with target SDK level

Clover supports apps with a target SDK level of 25 or earlier.

Starting 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 make sure your apps function correctly and are approved for publication on the Clover App Market, set the targetSdkVersion to 25 or lower.

If you use Android Studio to generate a signed APK for your app, you may receive an error message:

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 are using the Android Emulator, set the target SDK version to the highest API level virtual device on which you have tested. For more information on target SDKs, see android:targetSdkVersion.

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

Clover deviceRelease nameAPI levelAndroid version
Mini 1
Mobile
KitKat19Android 4.4
FlexLollipop22Android 5.1
Station 2018Nougat25Android 7.1.1
Station Duo
Mini 2
Flex 2
Oreo27Android 8.0
Station Solo
Mini 3
Flex 3
Q/1029Android 10

Compile SDK

Set the compile SDK version compileSdkVersion to the highest API level available from Google, as listed in the SDK Platform release notes. Your IDE uses this version to compile your app when you publish a .apk file. Using the highest available level ensures that all software libraries in your project compile successfully.

The API level of the device determines which APIs your app can use at runtime. Example: If a class or method is added in API level 25 of the Android SDK, the device must run an operating system with API level 25 for that API to be available. Attempts to use APIs beyond the device’s current API level will fail. For more information, see Support different platform versions.

Example build files

If 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 needs 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
    ...
  }
  ...
}