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 aRunnable
to the UI thread through aandroid.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¶
onReaderRemoved¶
onReaderStateChanged¶
-
void
onReaderStateChanged
(Reader reader)¶ Called when the state of a reader changes (e.g. insertion or withdrawal of a card, …).
Parameters: - reader – the affected
Reader
object. Its properties can be consulted (e.g. usingReader.getStatus()
,Reader.isCardPresent()
, …) to obtain more information about the event.
- reader – the affected
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 theonReaderXXX
or theonTokenXXX
events, but you cannot use both.Parameters: - reader – the
Reader
in which the token is located.
- reader – the
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 theonReaderXXX
or theonTokenXXX
events, but you cannot use both.Parameters: - reader – the
Reader
in which the token was located.
- reader – the