Hi we are in the early stages of building a terminal app for the Poynt device however whenever I print something I am confronted by the following dialog:
It prints fine and I can print again once I dismiss the dialog. I am binding to the IPoyntReceiptPrintingService within another service in its onStartCommand, code follows:
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
bindService(new Intent(IPoyntReceiptPrintingService.class.getName()),
printerConnection, Context.BIND_AUTO_CREATE);
return super.onStartCommand(intent,flags,startId);
}
@Override
public void onDestroy(){
super.onDestroy();
unbindService(printerConnection);
}
/**
* Class for interacting with the SessionService
*/
private ServiceConnection printerConnection = new ServiceConnection() {
@Override
public void onServiceConnected(android.content.ComponentName name, IBinder service) {
Log.e("PrinterTestActivity", "PrinterTestActivity is now connected");
printingService = IPoyntReceiptPrintingService.Stub.asInterface(service);
}
@Override
public void onServiceDisconnected(android.content.ComponentName name) {
Log.e("PrinterTestActivity", "PrinterTestActivity has unexpectedly disconnected");
printingService = null;
}
};
Here is a stacktrace
01-19 16:00:24.400 25777-25777/? E/AndroidRuntime: FATAL EXCEPTION: main Process: co.poynt.services, PID: 25777 java.lang.NullPointerException at co.poynt.services.ReceiptPrintingService$1$2.run(ReceiptPrintingService.java:274) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) 01-19 16:00:33.556 32688-32688/? E/PrinterTestActivity: PrinterTestActivity polling service connected 01-19 16:00:39.287 25777-1372/? E/CO.POYNT.SERVICES: printerdbg: -----TIMEOUT ----ReceiptPrintingService
01-19 16:05:27.425 9322-9567/? E/CO.POYNT.SERVICES: Terminal is currently in zombie mode, should not call server.
01-19 16:05:27.434 9322-9567/? E/CO.POYNT.SERVICES: Exception received while activating terminal:PoyntAPIException{HTTP statusCode=403 apiErrorCode=STORE_DEVICE_NOT_ACTIVATED Network Error? false}
01-19 16:05:27.436 6661-7420/? E/CO.POYNT.TERMINAL: PoyntError{code=0, httpStatusCode=403, apiErrorCode=STORE_DEVICE_NOT_ACTIVATED, reason=‘Terminal is currently not recognized by server.’, data=‘null’, requestId=‘null’, throwable=}