org.simalliance.openmobileapi
Class SEService

Object
  extended by org.simalliance.openmobileapi.SEService

public class SEService
extends Object

The SEService realizes the communication to available Secure Elements on the device. This is the entry point of this API. It is used to connect to the infrastructure and get access to a list of Secure Element Readers.


Nested Class Summary
static interface SEService.Callback
          Interface to receive call-backs when the service is connected.
 
Constructor Summary
SEService(Object context, SEService.Callback listener)
          Establishes a new connection that can be used to connect to all the Secure Elements available in the system.
 
Method Summary
 Reader[] getReaders()
          Returns the list of available secure element readers.
 boolean isConnected()
          Tells whether or not the service is connected
 void shutdown()
          Releases all Secure Elements resources allocated by this SEService.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SEService

public SEService(Object context,
                 SEService.Callback listener)
Establishes a new connection that can be used to connect to all the Secure Elements available in the system. The connection process can be quite long, so it happens in an asynchronous way. It is usable only if the specified listener is called or if isConnected() returns true. The call-back object passed as a parameter will have its serviceConnected() method called when the connection actually happen.

Parameters:
context - The context of the calling application.
listener - A SEService.Callback object.
Method Detail

getReaders

public Reader[] getReaders()
Returns the list of available secure element readers. Returned objects are not duplicated

Returns:
the readers list, as an array of Readers. If there are no readers the returned array is of length 0.

isConnected

public boolean isConnected()
Tells whether or not the service is connected

Returns:
true if the service is connected

shutdown

public void shutdown()
Releases all Secure Elements resources allocated by this SEService. It is recommended to call this method in the termination method of the calling application (or part of this application) which is bound to this SEService.


Copyright © 2010-2011 Inside Secure
Except as noted, this content is licensed under Apache 2.0 License.