Add RFID identification to a Java application

This example presumes you already have some basic knowledge about Arduino and programming Java applications with Eclipse.

If you have an RFID reader module attached to your computer (via a USB serial connection) you can read RFID data from a Java application. For instance, you can use the unique id (Card UID) to identify something or someone.

You can learn how to build you own RFID reader here.

To use serial communication in Java you need a library like jSerialComm. If you are starting a new project, download the .jar file, copy it to the root folder of your Eclipse project and import it (right click it and select Build Path > Add to Build Path).

You can use this application as an example (extract the zip-file and import it into Ecplise via File > Import > Existing projects into Workspace). It already contains the jSerialComm library.

The example has a class SerialGUI which is a simple userinterface with a label which shows a welcome message if a know RFID is scanned:

rfid_id_java_code1