*New - Java ECR SDK – Integration Library
Prerequisites
Install the required environment before using the SDK.
- JDK 8 or later
- Windows 10 or later (native library dependency)
- Place the ECR native library (
.dll) injava.library.path
Note: Earlier versions of the Java SDK required a DLL dependency (java.library.path). The current release supports pure‑Java integration without DLLs.
- Use the DLL‑free approach for new projects.
- Use the DLL‑based approach only for backward compatibility.
For integration steps, refer to Java SDK Integration.
Library Import
Add the JNI wrapper and import the SDK classes.
import java.net.Socket;
import java.io.*;
Declare native methods for request packing and response parsing.
public static native int pack(String reqData, int txnType, String signature, byte[] buffer);
public static native int parse(byte[] response, byte[] fields);
Core Components
Use the SDK’s native functions to build and parse transaction data.
pack()– Format request data into a buffer.parse()– Extract response fields from terminal output.Socket– Establish TCP/IP connection with the terminal.
Configuration Persistence
- The SDK uses
java.library.pathto locate the native.dll. - Connection parameters (IP, port) are defined at runtime in the client code.
- No external JSON configuration file is required.
Runtime Behaviors
- The SDK manages communication through socket connections.
- Establish TCP/IP session with the terminal.
- Send packed request data using
pack(). - Receive terminal response and parse with
parse(). - Close the socket after transaction completion.
Transaction Flow
Initialize SDK → Configure POS → Connect Device → Pack Request → Execute Transaction → Receive Response → Parse Response
Updated about 1 hour ago
