Java REST development
Introduction
In order to understand how the REST API works on Keonn Systems, we provide some Java examples you can run on your PC.
We are testing these examples in our office to maximize their performance and ensure their stability. You can modify them to add or test more features depending on your needs.
You can find our examples in our GitHub page: https://github.com/Keonn-Technologies/JavaRestExamples
These examples work for AdvanReader-150 and AdvanReader-60.
Requirements
We provide the example as an Eclipse project, therefore you need the following software:
Eclipse Java EE IDE
Java JDK
Available examples
For now, the available examples are the following ones. More examples are coming soon:
ADRDAsynch: the program works as follows:
Gets the IP address from the arguments.
Changes to Autonomous mode, if available.
Makes sure the reader is started before proceeding.
Reads from the TCP port (3177) and prints out the tags read on the console.
It also counts and outputs the tags read every day among the total, and keeps the reader running in case it has been stopped by accident.
How to run the examples
To run any of the examples, you should follow these steps:
Download the examples .zip
Uncompress the .zip
Open Eclipse IDE and create a new Java project: Click on File --> New --> Java Project
4. Disable "Use default location" and browse to find the unzipped folder:
5. Click on Finish and open the folder tree until you find the .java example:
6. Create a Run config: Click on the green button and then on Run Configurations...
7. Right click on Java Application, click on New* and Select a name(1). Browse the folder(2) and then Click on Search(3) to specify the main class:
8. Go to the Arguments tab and specify your device IP on "Program arguments:" text area:
9. Click on Apply and then Run
10. The program should be running and printing on the console: