ReaderEvents ============ .. java:package:: com.idopte.scmapi :noindex: .. java:type:: 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 \ :java:ref:`android.app.Activity.runOnUiThread(Runnable)`\ , or post a \ :java:ref:`Runnable`\ to the UI thread through a \ :java:ref:`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 \ :java:ref:`SCMUtils.openWaitForTokenDialog(Activity)`\ . Methods ------- onReaderAdded ^^^^^^^^^^^^^ .. java:method:: void onReaderAdded(Reader reader) :outertype: ReaderEvents Called when a new reader is plugged on the device, or a bluetooth reader discovered. :param reader: the new \ :java:ref:`Reader`\ object. onReaderRemoved ^^^^^^^^^^^^^^^ .. java:method:: void onReaderRemoved(Reader reader) :outertype: ReaderEvents Called when a reader is unplugged from the computer. :param reader: the removed \ :java:ref:`Reader`\ object. onReaderStateChanged ^^^^^^^^^^^^^^^^^^^^ .. java:method:: void onReaderStateChanged(Reader reader) :outertype: ReaderEvents Called when the state of a reader changes (e.g. insertion or withdrawal of a card, ...). :param reader: the affected \ :java:ref:`Reader`\ object. Its properties can be consulted (e.g. using \ :java:ref:`Reader.getStatus()`\ , \ :java:ref:`Reader.isCardPresent()`\ , ...) to obtain more information about the event. onWaitForTokenUserDismissed ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: void onWaitForTokenUserDismissed() :outertype: ReaderEvents Called when the "wait for token" dialog is dismissed by the user's initiative (by touching outside the dialog).