Platform Docs

Emulator Setup in Android Studio

Overview

We recommend using a Clover Developer Kit to fully test your user experience. This will also allow you to access hardware-specific functionality like NFC, other secure payments, printing, and scanning. However, if you are not relying on those functionalities, it is also possible to use an emulator to quickly prototype, develop, and test your Clover applications.

NOTE

This page documents the process of setting up an emulator in Android Studio for Clover app development. However, the configuration of any Android emulator should be similar.

Download the Clover hardware profiles

Clover maintains a profile of each device that you can import into the emulator.

  1. Open Emulator Hardware Profiles.
  2. Copy and save the profile of each device you want to emulate:
    • clover-flex.xml
    • clover-mini.xml
    • clover-mini-2nd-gen.xml
    • clover-mobile.xml
    • clover-station.xml
    • clover-station-2018.xml

NOTE

The hardware profiles for the Clover Mini, Mini 2nd Gen, and Mobile require a specific DPI that may be overridden if you make changes to the profile. To verify the setting is correct, open USERHOME\.android\avd\virtual-device-name.avd\config.ini and ensure hw.lcd.density is set to 213.

Create a new emulator

  1. Launch Android Studio.
  2. On the toolbar, click AVD Manager.
    The Android Virtual Device Manager window appears.
  3. Click Create Virtual Device.
  4. On the Virtual Device Configuration window, click Import Hardware Profiles.
  5. Navigate to the profile you downloaded, select it, and click OK.
  6. From the list of devices, select the Clover profile, and then click Next.
  7. On the System Image page, select the image for the API Level supported on the Clover device you are emulating, and then click Next:

NOTE

Android 6.0 introduced "grant at runtime" permissions: users grant permissions to apps while the app is running, not when they install the app. https://developer.android.com/training/permissions/requesting.html

If you are developing on a Clover emulator, target API 21 or lower. This will use the "grant at install" permission model, which is the model Clover devices follow. If you target API 23 or above and implement the grant at runtime flow, the same application will run correctly on Clover devices without modification.

Clover device
Release name
API level
API
Target

Station

Jelly Bean

17

x86

Android 4.2

Mobile/Mini (1st gen)

KitKat

19

x86

Android 4.4

Flex

Lollipop

22

x86

Android 5.1

Station 2018

Nougat

25

x86

Android 7.1.1

Mini (2nd gen)

Oreo

27

x86

Android 8.1

NOTE

You may need to click the x86 Images tab to find the Android release version needed for your emulator. If the system image is not already available locally, click Download and install the image.

Download a system image without the Google APIs. Clover devices are not Google Play certified and therefore do not come with Google Play Services.

  1. On the Verify Configuration page, verify the correct Startup orientation is selected:
Clover device
Startup orientation

Station

Landscape

Mobile/Mini (1st gen)

Landscape

Flex

Portrait

Station 2018

Landscape

Mini (2nd gen)

Landscape

  1. Click Show Advanced Settings.
  2. Change the RAM value to the amount for the device you are emulating:
Clover device
RAM (GB)

Station

2

Mobile/Mini (1st gen)

2

Flex

1

Station 2018

3

Mini (2nd gen)

2

  1. Change the Internal Storage value to the amount for the device you are emulating:
Clover Device
Internal storage (GB)

Station

5

Mobile/Mini (1st gen)

6

Flex

5

Station 2018

10

Mini (2nd gen)

7

  1. Click Finish.
    The new virtual device is added.
  2. In the Actions column for the device, click Launch (right-facing triangle).
    The emulator launches.

Installing Clover APKs using ADB

  1. Using a web browser, navigate to the Development APKs page.
  2. Click to download com.clover.engine-<version>.apk and com.clover.appupdater-<version>.apk.
  3. In Android Studio, open the Terminal (Alt+F12/Option+F12).
  4. To verify that ADB is connected to the emulator, run the following command: adb devices.
    A response like the following appears.
List of devices attached
emulator-5554    device
  1. To install the Clover Engine APK, run adb install <download_folder>/com.clover.engine-<version>.apk.
  2. To install the Clover App Updater APK, run adb install <download_folder>/com.clover.appupdater-<version>.apk.
    A Success message appears for each APK. Leave the terminal window open.

Configuring the emulator to run as a Clover device

Once you have installed the APKs, you must set up the Clover system account and set the Clover launcher as the home application.

  1. Open the Settings app.
  2. In the Personal section, click Accounts.
  3. Click Add Account.
  4. On the Add an account page, click Clover.
  5. On the Log in page, enter your sandbox developer credentials, and click Log In.
  6. In the terminal window, run adb reboot.
    The emulator reboots. When the emulator powers on, the Clover base apps are synced to the emulated device. This process may take several minutes as all of the apps are downloaded. Download progress can be seen in the Clover App Updater notification. Wait until the notification says Updates are installing.

Installing the Clover Apps

  1. Click the Clover App Updater notification.
    The App Updater app opens and lists the number of updates available.
  2. Click Install Now.
  3. For each app, scroll to the end of the permissions list and then click Install.
  4. Return to the Settings menu.
  5. In the Device section, click Apps.
  6. In the upper-right corner, click Configure Apps (gear icon).
  7. On the Configure Apps page, click Home app.
  8. On the modal, click Launcher (com.clover.launcher).
    The Clover Launcher is set as the home app.