public abstract class ServiceConnector extends java.lang.Object implements IIngenicoApi
Modifier and Type | Class and Description |
---|---|
protected class |
ServiceConnector.InternalServiceConnection
Internal class for service connection.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_BIND_V2 |
protected static java.lang.String |
SERVICES_PACKAGE |
Modifier | Constructor and Description |
---|---|
protected |
ServiceConnector(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
void |
connect(ConnectionListener listener)
Connect to the service.
|
protected boolean |
connectSync()
Synchronized connection to the service.
|
void |
disconnect()
If connected, disconnect from the service.
|
protected void |
ensureServiceIsReady() |
protected android.content.Intent |
getBindIntent()
Can be overrided to connect to other services
|
protected android.content.Context |
getContext() |
protected abstract java.lang.String |
getServiceName()
Must be overrided to provide service class name used for binding.
|
boolean |
isConnected()
True if the connection to the service has been done.
|
protected abstract void |
onServiceReady(android.os.IBinder service)
Internal callback when service is connected.
|
protected abstract void |
onServiceUnbinded()
Internal callback when service is disconnected.
|
protected static final java.lang.String SERVICES_PACKAGE
public static final java.lang.String ACTION_BIND_V2
protected android.content.Context getContext()
public void connect(ConnectionListener listener)
connect
in interface IIngenicoApi
listener
- Callback listener to be notified when the connection is readypublic void disconnect()
disconnect
in interface IIngenicoApi
public boolean isConnected()
isConnected
in interface IIngenicoApi
protected android.content.Intent getBindIntent()
protected boolean connectSync()
protected void ensureServiceIsReady() throws IngenicoException
IngenicoException
protected abstract java.lang.String getServiceName()
protected abstract void onServiceReady(android.os.IBinder service)
service
- protected abstract void onServiceUnbinded()