Quick Start
This guide takes the SDK Demo App from the delivered source to a running app on your terminal.
Before you begin
Confirm you meet the Prerequisites.
Step 1: Get the project
The demo app source code is delivered inside the toolkit, already extracted, at devkit-source/apolo-devkit/. Open that folder in Android Studio through File → Open….
Complete Step 2 before syncing the project.
Step 2: Set the Gradle JDK to 21
The project compiles only with JDK 21. The typical sync error when it is missing is Unsupported class file major version.
- Open Settings — on Windows and Linux
File → Settings, on macOSAndroid Studio → Settings. - Go to Build, Execution, Deployment → Build Tools → Gradle.
- Under Gradle JDK, select a JDK 21 — for example the bundled JetBrains Runtime 21 (
jbr-21), or download one through Download JDK…. - Click Apply/OK and run Gradle Sync again.
Step 3: Select the variant and run
The app defines the country flavor dimension with the brazil flavor as default, combined with the debug and hml build types. Run the default brazilHml variant.
For each variant, app/build.gradle.kts adds the SDK dependency as com.pagonxt.sdk:<flavor>-<buildType> — for example com.pagonxt.sdk:brazil-hml, version 1.0.0-SNAPSHOT. It resolves from the local Maven repository bundled at apolo-sdk-local-maven/brazil/<buildType>.
From Android Studio
- Open the Build Variants window through
View → Tool Windows → Build Variants. - In the
:appmodule, set Active Build Variant tobrazilHml. - Select the
apprun configuration, connect the terminal, and click Run.
From the command line
## Default (Brazil) HML build — compiles and installs
./gradlew :app:installBrazilHml
## Unit tests
./gradlew :app:testBrazilHmlUnitTestThe ./gradlew :app:installBrazilHml command completes and the app opens on the terminal.
Step 4: Provide credentials
The demo app initializes the SDK with your integrator credentials: clientId, clientSecret, terminalCode, and the sub-merchant data. On the first launch, the Setup screen lets you type them manually or read them from a QR Code.
Generate the QR Code
The demo app ships the CredentialsQrCode component at app/src/main/java/com/pagonxt/apolo/devkit/internal/design/components/CredentialsQrCode.kt. It uses ZXing to build a QR Code from a JSON payload.
The sample values live in two functions: buildMandatoryCredentialsPayload() for the mandatory credentials only, and buildFullCredentialsPayload() for the credentials plus the sub-merchant data.
private fun buildFullCredentialsPayload(): String {
return JSONObject().apply {
put("clientId", "...")
put("clientSecret", "...")
put("terminalCode", "...")
put("subMerchantId", "...")
put("city", "...")
put("state", "...")
put("postalCode", "...")
put("document", "...")
put("street", "...")
put("phone", "...")
put("corporateName", "...")
put("url", "...")
put("foreignType", "FULL_DOMESTIC")
}.toString()
}To use your own credentials:
- Replace the values in
buildMandatoryCredentialsPayload()orbuildFullCredentialsPayload()with your onboarding data. - Open the
MandatoryCredentialsQrCode_PrevieworFullCredentialsQrCode_PreviewCompose preview in Android Studio and click Build & Refresh. - Use the resulting QR Code on the Setup screen.
Read the QR Code
On the Setup screen, choose the read QR Code option and point the terminal at the QR Code. The configuration fields fill automatically and the SDK initializes with the correct credentials.
Step 5: Verify
Run through the checks below. Each one confirms a different part of the setup.
| Check | What to expect |
|---|---|
| Gradle sync | Completes without JDK errors such as Unsupported class file major version. |
| Dependency resolution | Resolves without credentials — the SDK comes from the bundled local Maven repository and the rest from Maven Central and Google. |
| Variant | :app is set to brazilHml. |
| Run | ./gradlew :app:installBrazilHml completes and the app opens. |
| Initialization | After entering the credentials, the SDK warm-up reports success and the main menu appears. |
Change the saved credentials
After the first save, the credentials persist in the app database and the demo app stops prompting Setup. To change them, use one of these:
- Reset — tap the reset button in the Home screen header to clear the credentials and return to Setup.
- Clear app data — go to Settings → Apps → Apolo DevKit → Storage → Clear data.
- Reinstall the app.
As a code alternative, fill in CLIENT_ID, CLIENT_SECRET, and TERMINAL_CODE in SetupCredentials.kt to initialize the SDK at build time and skip the Setup screen.
Next steps
- Customize the SDK — the two customization models the demo app demonstrates.
- Troubleshooting — the common symptoms at each step above, and how to resolve them.
- SDK White Label — Quick Start — integrate the SDK into your own app.
README.mdinside the extracted project atdevkit-source/apolo-devkit/— repository overview, focus map, and per-client integration surface.