Android SDK

Read the Getting Started chapter, then follow these steps to connect the POS system to the Smart Peak/N86/UN20 terminal using the Android SDK.

Supported Connections

Connection TypeSupportedNotes
TCP/IP (Wi‑Fi)Recommended for stable and fast setup. Uses socket connection with terminal IP + port.
BluetoothRequires pairing the terminal with the POS/mobile device first, then connecting via SDK.
Serial (COM)Not supported on Android SDK. Serial is limited to desktop SDKs (Java, .NET).

TCP/IP (Wi‑Fi) and Bluetooth

Sample Application Flow

Step 1: Add SDK to Project

  • Download the Android SDK package (SkyBandSDK-release.aar).
  • Place the .aar file in your project’s libs folder.
  • Add the dependency in build.gradle:
implementation files('libs/SkyBandSDK-release.aar')
  • Sync the project.

Step 2: Configure Permissions

  • Open AndroidManifest.xml.
  • Add required permissions:
<!-- General -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<!-- Bluetooth -->
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>

<!-- USB -->
<uses-permission android:name="android.permission.USB_PERMISSION"/>

<!-- Storage -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Note: Permissions vary by connection type. Ensure only relevant permissions are enabled.

Step 3: Establish Connection

  • Ensure the Nami payment terminal is powered on.
  • Select connection method:
    • TCP/IP: Ensure both devices are on the same network. Use terminal IP address.
    • Bluetooth: Pair the terminal with the Android device. Use paired device details..

  • Initialize the SDK and establish connection.

Step 4: Register Terminal

  • Send a Register request with txnType = 17 and your Cash Register Number.
  • Expected Result: Success response confirming registration.

Important: Registration is required only for legacy ECR integrations. Local and Cloud Middleware integrations do not require this step.

Step 5: Start Session

  • Send a Start Session request with txnType = 18.
  • Expected Result: Session start confirmation.

Important: Applies only to legacy ECR integrations. Not required for Local or Cloud Middleware integrations.

Step 6: Perform Transaction

Send a Purchase request::

txnType: 0
amount: "100"   // SAR 1.00 (amount in halalas)
ecrRefNo: "12345678900001"
date: "ddMMyyHHmmss"
  • Note: Transaction amount is in halalas. The amount will display on the terminal.

Step 7: Process Response

  • Receive the response from the terminal.
  • Use SDK utilities to parse the response.
  • Extract:
    • Response code (String)
    • Approval code (String)
    • Receipt data (String/JSON)

Code Integration Flow

Provide equivalent Java/Kotlin snippets for each step (Add SDK, Configure Permissions, Establish Connection, Register, Start Session, Purchase, Response Parsing).

Notes on Legacy vs Adapter

  • Legacy ECR Integrations: Require Register and Start Session steps.
  • ECR Adapter Integrations: Do not require Register/Session.
  • Documented separately to avoid confusion.