Before you can send commands to the Keycard, you must first connect to the card. Connection handling is the only task which is handled differently between Android an the desktop.
On Android, the NFC connection handling must happen on a thread separate from the UI thread. The SDK provides the class NFCCardManager
to handle this. This an example activity starting the NFC reader and handling the connection to the card. Refer to the comments in the example for more information.
On the desktop we use the javax.smartcardio library. There are several ways to handle connections, the important part is getting a CardChannel open. Below is an example of how this can be achieved (assumes that a single smartcard reader is connected).