Hi,
We’re able to invoke the bar code scanner but it seems to be getting stuck while scanning the barcode, meaning it does not invoke the listener after scanning the barcode.
We’re using the following gradle dependencies:
compile ‘co.poynt.api:android-api-model:1.2.32@jar’
compile ‘co.poynt.android.sdk:poynt-sdk:1.2.8@aar’
Code snippet:
private ServiceConnection mSecondScreenConnection = new ServiceConnection() {
// Called when the connection with the service is established
public void onServiceConnected(ComponentName className, IBinder service) {
Log.d(TAG, “IPoyntSecondScreenService is now connected”);
// Following the example above for an AIDL interface,
// this gets an instance of the IRemoteInterface, which we can use to call on the service
mSecondScreenService = IPoyntSecondScreenService.Stub.asInterface(service);
}// Called when the connection with the service disconnects unexpectedly public void onServiceDisconnected(ComponentName className) { Log.d(TAG, "IPoyntSecondScreenService has unexpectedly disconnected"); mSecondScreenService = null; } };
IPoyntSecondScreenCodeScanListener scanListener = new IPoyntSecondScreenCodeScanListener.Stub() {
@Override
public void onCodeScanned(String s) throws RemoteException {
if (s != null) {
testText.setText("Scanned Code: " + s);
}
}@Override public void onCodeEntryCanceled() throws RemoteException { testText.setText("Scan onCodeEntryCanceled! "); } };
mSecondScreenService.scanCode(scanListener);