Android Overview
  • 30 Aug 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Android Overview

  • Dark
    Light


Make sure Application has permission to use Internet!

Android uses its built-in Socket functions. It does not require any extra importing. The result from testing the connection will be inside the connectionLog property. Please view the code samples on the right-hand side of your screen.

Code Samples

[Java]To Do This, Open The Android Manifest File And Add This Line Of Code.

<uses-permission android:name="android.permission.INTERNET" />

[Java]Creating And Initializing The Class


// CREATE CLASS
hcmTerminal terminal;

// INITIALIZE CLASS
terminal = new hcmTerminal();

[Java]Settings Needed For The Class


// SAVE SETTINGS
terminal.terminalIp = "127.0.0.1";
terminal.terminalPort = 8080;

[Java]Processing Different Types. * Some Require You To Set Amount,ClerkId,InvoiceNumber


// PUCHASE
terminal.amount = 100;
terminal.clerkId = 525;
terminal.invoiceNumber = 111;
terminal.hcmPurchase();

// REFUND
terminal.amount = 100;
terminal.clerkId = 525;
terminal.invoiceNumber = 111;
terminal.hcmRefund();

// VOID
terminal.hcmVoid();

// PREAUTH
terminal.amount = 100;
terminal.clerkId = 525;
terminal.invoiceNumber = 111;
terminal.hcmPreAuth();

// CAPTURE
terminal.amount = 100;
terminal.clerkId = 525;
terminal.invoiceNumber = 111;
terminal.hcmCapture();

// SETTLE
terminal.hcmSettle();

// REPRINT
terminal.hcmRePrint();

[Java]Testing Connection *Make Sure Ip And Port Are Already Set


// TEST CONNECTION
terminal.hcmTestConnection();