Get Started

Synqpay SDK main class is a singleton class that applies ServiceConnection to Synqpay Service.

The SDK needs to be initiated with Context object, thus if is intended to use from multiple activities and/or fragments it's strongly recommended to init with Application's Context.

SynqpaySDK.get().init(this);

Once SDK is initiated it can be bounded to Synqpay Application. Since the binding process is asynchronous , its needed to add a callback set to the process.

1
2
3
4
public interface ConnectionListener {
    void onSynqpayConnected();
    void onSynqpayDisconnected();
}
SynqpaySDK.get().setListener(connectionListener);
SynqpaySDK.get().bindService(); 

Info

Once application exit or no need to use Synqpay anymore the client should unbind from Synqpay

SynqpaySDK.get().unbindService(); 

Once Synqpay is bounded client application can start use Synqpay:

1
2
3
4
5
6
@Override
public void onSynqpayConnected() {  
    SynqpayApi api = SynqpaySDK.get().getSynqpayAPI(); 
    SynqpayManager manager = SynqpaySDK.get().getSynqpayManager(); 
    SynqpayPrinter printer = SynqpaySDK.get().getSynqpayPrinter();
}