LINKS
LINKS
How to Save Scan Images from Newland PDA via API
Announcer: Alan Time: 13th Mar 2025
Share to :
MORE
3 views 0 comments

How to Save Scan Images from Newland PDA via API

1. Import the Required Libraries 

   Import `ScanToolLib.jar` and `libnlstools_jni.so` into your source code project. 

2. Implement the method

   Create an object of the `ScanTool` class, implement the `SetOnImageListener` interface, and override the `OnPreViewCallBack` method. This method returns information about the decoded image. 

   Example Source Code: 

   ScanTool scanTool = new ScanTool(this); // Create an object 

   scanTool.SetOnImageListener(this); // Implement the callback interface 

   scanTool.Connect(DE3_WIDTH, DE3_HEIGHT, 1); // Initialize 

   @Override

   public void OnPreViewCallBack(byte[] data, int width, int height, int decodeState,

                                  CodeCoordinate coordinate, int centerX, int centerY,

                                  int codeType, byte[] code) {

       String codeStr = "";

       if (code != null && code.length > 128) // The first 128 bytes are the header and need to be removed 

           codeStr = new String(code, 128, code.length - 128, StandardCharsets.UTF_8); // Always convert in this format 

   }

 

   Parameter Description: 

   - `data`: Image data 

   - `width`: Image width 

   - `height`: Image height 

   - `decodeState`: Decode status (1 for success, others for failure) 

   - `coordinate`: Barcode coordinates 

   - `centerX`: X-coordinate of the cross laser (within the image) 

   - `centerY`: Y-coordinate of the cross laser 

   - `codeType`: Barcode type 

   - `code`: Barcode content 

 

3. Process the Returned Image Data 

   Perform the necessary processing based on the returned image data. For more details, refer to the demo program "ScanImageSave.apk" and its sample code. 

Download Related Files 

You can download the required files from the following link: 

https://ccloud.ndevor.biz/s/HE6YN3BQPwECdNZ

 

Contents of the Link: 

- API Documentation: 

  - How to Save Scan Images from Newland PDA via API.doc 

 

- Demo Program & Source Code: 

  - ScanImageSave-2.0.apk 

  - ScanImageSave 

- API Files: 

  - arm64-v8a/libnlstools_jni.so 

  - armeabi-v7a/libnlstools_jni.so 

  - ScanToolLib.jar 

All comments (0)
POPULAR TAGS