public final class TerminalInfo extends ServiceConnector implements ITerminalInfo
ServiceConnector.InternalServiceConnection
ACTION_BIND_V2, SERVICES_PACKAGE
Modifier and Type | Method and Description |
---|---|
static ITerminalInfo |
getInstance(android.content.Context context)
Return a global instance of TerminalInfo, which is the default implementation of
ITerminalInfo , and instantiate it if needed. |
protected java.lang.String |
getServiceName()
Must be overrided to provide service class name used for binding.
|
TerminalInfoResult |
getTerminalInfo()
Retrieve terminal information (software and hardware).
|
protected void |
onServiceReady(android.os.IBinder service)
Internal callback when service is connected.
|
protected void |
onServiceUnbinded()
Internal callback when service is disconnected.
|
connect, connectSync, disconnect, ensureServiceIsReady, getBindIntent, getContext, isConnected
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, disconnect, isConnected
public static ITerminalInfo getInstance(android.content.Context context)
ITerminalInfo
, and instantiate it if needed.
Be aware that only one instance will be created for the whole application, so the associated
context should not be a component which could be destroyed at some point, ie. an Activity.
Passing the Application
to this method is preferred over other context types.
context
- A valid context to initialize the instance.public TerminalInfoResult getTerminalInfo() throws IngenicoException
Example:
ITerminalInfo
terminalInfo = TerminalInfo.getInstance(context);TerminalInfoResult
terminalResult = terminalInfo.getTerminalInfo();
getTerminalInfo
in interface ITerminalInfo
IngenicoException
- when the getTerminalInfo call failsprotected java.lang.String getServiceName()
ServiceConnector
getServiceName
in class ServiceConnector
protected void onServiceReady(android.os.IBinder service)
ServiceConnector
onServiceReady
in class ServiceConnector
protected void onServiceUnbinded()
ServiceConnector
onServiceUnbinded
in class ServiceConnector