ReaderEvents

public interface ReaderEvents

Interface used to received smart card reader events.

The methods are not called within the context of the main UI thread. If UI actions must be made within these methods, you can delegate the operation to android.app.Activity.runOnUiThread(Runnable), or post a Runnable to the UI thread through a android.os.Handler.

Also note that due to system restrictions, it is only possible to correctly report events when the Smart Card Middleware application is in foreground (not the target application). See SCMEnvironment.openWaitForTokenDialog(Activity).

Methods

onReaderAdded

void onReaderAdded(Reader reader)

Called when a new reader is plugged on the device, or a bluetooth reader discovered.

Parameters:
  • reader – the new Reader object.

onReaderRemoved

void onReaderRemoved(Reader reader)

Called when a reader is unplugged from the computer.

Parameters:
  • reader – the removed Reader object.

onReaderStateChanged

void onReaderStateChanged(Reader reader)

Called when the state of a reader changes (e.g. insertion or withdrawal of a card, …).

Parameters:

onTokenArrival

void onTokenArrival(Reader reader)

Called when a token becomes available on a reader.

Note: this method is called from the default implementation of the onReaderXXX methods, and can’t be used if their implementation is overridden. You have to either use the onReaderXXX or the onTokenXXX events, but you cannot use both.

Parameters:
  • reader – the Reader in which the token is located.

onTokenRemoval

void onTokenRemoval(Reader reader)

Called when a token is made unavailable (by removing it from the reader, or when the reader is removed).

Note: this method is called from the default implementation of the onReaderXXX methods, and can’t be used if their implementation is overridden. You have to either use the onReaderXXX or the onTokenXXX events, but you cannot use both.

Parameters:
  • reader – the Reader in which the token was located.