From a fresh machine to a debug build of WAVit Payments on a Clover dev kit, a terminal set up against a test merchant, and a first test sale. Plan on about an hour. One step needs a teammate (setting up the terminal), so ask for it early.
Checked against master at 6653919 on .
| What | Version or detail | Why |
|---|---|---|
| JDK | 17 | Gradle 7.6.4 does not run on newer JDKs, and the Clarity SDK ships Java 17 bytecode. The committed IDE settings call it ms-17. |
| Android Studio | A release that supports Android Gradle Plugin 7.4.2 | To open and run CloverWAVitPayments/ |
| Android SDK | Platform 31, plus the platform tools for adb | compileSdkVersion 31 in app/build.gradle (minSdk 17, targetSdk 29) |
| Gradle | 7.6.4, through the wrapper | Nothing to install |
| Clover dev kit | Activated and logged into a Clover sandbox test merchant | The app reads the merchant and serial number from Clover at startup |
| Access | The WavitSystems project in Azure DevOps, and a teammate who can set up terminals in the WAVit Configurator | To clone the repo, and to give your dev kit its settings |
Without a Clover account the splash screen stops at Merchant not found, and without a Clover serial number (one starting with C) it stops at Device Not Set Up. Use an emulator for the Espresso tests and the dev kit for everything else.
master is the main line: every change reaches it through a reviewed pull request, and the production pipeline builds each pull request into master. Branch from it as feature/<name>, or hotfix/<name> for a fix to a released version, and mention the work item as AB#<id> in your commit messages.
git clone https://micampdev.visualstudio.com/WavitSystems/_git/WAVitPayments
cd WAVitPayments
git switch -c feature/<short-name>
cd CloverWAVitPayments # the Gradle project: open this folder in Android StudioThe build does not pick a JDK for you, and the wrong one fails in a confusing way.
The shared gradle.properties leaves org.gradle.java.home out on purpose, because the path differs per machine. Set it in your own Gradle properties file, or choose a JDK 17 as the Gradle JDK in Android Studio. The pipelines get JDK 17 through JAVA_HOME instead.
org.gradle.java.home=C:/Users/<you>/.jdks/<jdk-17-folder>Command-line builds also need to find the Android SDK. Android Studio writes local.properties the first time it opens the project, and the file is git-ignored. Without Android Studio, create it yourself:
sdk.dir=<path to your Android SDK>./gradlew --version
# Gradle 7.6.4
# JVM: 17.x <- this line must say 17./gradlew --version also succeeds on JDK 25 and just reports that JVM. The first real task then fails while compiling settings.gradle with Unsupported class file major version 69. Read the JVM line, not the exit code.
| Flavor | Application id | Talks to | Use it for |
|---|---|---|---|
development | com.micamp.wavitpayments.dev | Dev MiPoint API, the PaymentsAgent test instance, Clover sandbox, Citcon UAT and DealerTrack staging. IS_PRODUCTION is false. | All local work, as developmentDebug |
production | com.wavit.prod | The production instance of each of those. IS_PRODUCTION is true. | Release builds from the pipeline |
Each base URL is a buildConfigField. The values sit in the ext block of the root build.gradle and are mapped into the two flavors in app/build.gradle. Read them through BuildConfig (for example BuildConfig.TOKEN_API_BASE_URL) rather than writing a host into the code. The two application ids differ, so both flavors can be installed on one device side by side.
productionDebug is only debug-signed. It talks to the production MiPoint API and to Clover production, so do not use it to try things out.
app/src/development/res holds copies of 404 strings, 47 colors, 70 dimens, 96 styles, a few drawables and its own launcher icon. A copy there wins over app/src/main/res in development builds, so when you change one of those resources in main, change the development copy too.
A debug build needs no keystore, properties file or secret. The debug signing config in app/build.gradle sets no keystore, so Gradle signs with the default Android debug key on your machine, with v1 signing on and v2 off as Clover requires.
Release builds are signed only when the WAVIT_* environment variables are set, which the pipelines do. You do not need a release build for this guide; Signing on the Resources page covers it.
Local signing settings have ended up in app/build.gradle by mistake before, and a later commit had to put the shared signing config back. Use the WAVIT_* variables or Android Studio's Generate Signed APK wizard (V1 only) instead, and check your diff before you push.
adb devices lists it.assembleDevelopmentDebug writes app/build/outputs/apk/development/debug/app-development-debug.apk. The first build downloads the project's dependencies, so it takes a while.installDevelopmentDebug builds and installs in one go. To install an APK you already have, use adb install -r.com.view.AnimatedSplashActivity, from adb.adb devices
./gradlew assembleDevelopmentDebug
./gradlew installDevelopmentDebug
adb shell am start -n com.micamp.wavitpayments.dev/com.view.AnimatedSplashActivityOn Windows the same commands work in PowerShell as .\gradlew, or as gradlew in cmd. In Android Studio, choose developmentDebug in the Build Variants panel, pick the dev kit as the target and press Run.
The terminal takes no payment until the server knows it. The first launch tells you exactly what to ask for.
integrationType Standalone, integrated off, and a Card tender enabled.POST api/authenticate), loads the settings (GET api/SqlConfig), checks the Clover Id and lands on the idle tap-to-start screen.includeInvoice, invoiceRequired), so type any test reference, then tap Next.disableSignature is on), then choose None or Print on the receipt screen. The app goes back to the idle screen.This dialog means the Clover Id in the Configurator is empty or names a different merchant from the one the dev kit is logged into. Fix the Clover Id and tap Retry; no reinstall is needed.
On master the only test is ExampleUnitTest. The real suites (JUnit tests for the money maths and Espresso tests for single screens) live on the espressoTesting branch, which is not merged yet. Switch to it to run them.
git switch espressoTesting
./gradlew testDevelopmentDebugUnitTest # JVM, no device
./gradlew testDevelopmentDebugUnitTest --tests "com.base.CalculationTest"
./gradlew connectedDevelopmentDebugAndroidTest # device or emulator, online
./gradlew connectedDevelopmentDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.view.TransactionActivityTestcom/micamp/wavitpayments/, but CalculationTest and CalculationTipDiscountTest declare package com.base.Configuration with settings and launch one screen each, so they need no Clover merchant and run on an emulator. The keypad tests need a network connection.| What you see | Why | What to do |
|---|---|---|
Unsupported class file major version when Gradle starts | Gradle is running on a JDK newer than 17 | Set org.gradle.java.home, or choose JDK 17 as the Gradle JDK in Android Studio |
Android Studio cannot find the Gradle JDK ms-17 | The committed .idea/gradle.xml names a JDK by that name | Pick any JDK 17 under Settings > Build, Execution, Deployment > Build Tools > Gradle, and leave the changed .idea/gradle.xml out of your commits |
SDK location not found | No local.properties and no ANDROID_HOME | Open the project once in Android Studio, or create local.properties as shown above |
INSTALL_FAILED_UPDATE_INCOMPATIBLE | The device already has com.micamp.wavitpayments.dev signed with another key: the sandbox app from the Clover dashboard, or a teammate's debug build | adb uninstall com.micamp.wavitpayments.dev, then install again. This deletes the app's data, unsent payment records included. |
| Merchant not found on the splash screen | No Clover account on the device: an emulator, or a dev kit that is not activated and logged into a merchant | Use an activated dev kit |
| Device Not Set Up: unable to retrieve the serial number | No serial number from Clover, or one that does not start with C | Use a Clover device |
| Device Not Set Up: not set up for merchant | api/authenticate answered 401, so the dev MiPoint API does not know the serial number. A terminal set up only in production does not count. | Have it set up (first sale, step 2), then tap Retry |
| Device Not Set Up: registered but has no WAVit settings | The device is known but has no settings | Ask for settings, then tap Retry |
| "Settings not fetched due to connectivity. Trying again" | A network or server error on the token or settings call | Check the dev kit's network connection, then retry |
| The keypad ignores taps and shows a toast | The keypad is gated on connectivity | Connect the device to the network |
The app writes a log file per day, WAVitLog<MM_dd_yyyy>.txt, to its own external files folder, and the Status screen shows the last seven days. To read them on your machine:
adb pull "/sdcard/Android/data/com.micamp.wavitpayments.dev/files/Log files/" ./wavit-logs