question

Alan avatar image
Alan asked pavan commented

Noticeable delay when printing (ViewPrintJob)

Hi Clover Dev, I'm using the ViewPrintJob to print my orders. However, I've found there's a delay of about 10 seconds sometimes between triggering the print and it actually printing.

I can't seem to reproduce the issue consistently, it appears to happen 1/10 (9/10 instant, 1/10 with a consistent delay of 10 seconds).

I'm on a sandbox mini using the built in printer.

It's not the end of the world, but is it something I could be doing wrong or would a clover merchant expect to wait for a print? Thanks, Alan

Relevant logcat:

Notice the triggering time and actual print time differ by 13 seconds.

09-01 20:53:41.663 884-1669/? I/ActivityManager: Start proc com.clover.seiko_lpt02_245 for content provider com.clover.seiko_lpt02_245/.PrinterContentProvider: pid=19278 uid=10029 gids={50029}
09-01 20:53:41.713 19278-19294/? D/PrinterController: Printer connect
09-01 20:53:41.722 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:25): +call method: hasPermission
09-01 20:53:41.726 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:56): +isAllowed method: com.clover.seiko_lpt02_245 UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@41d25320]
09-01 20:53:41.727 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:74): returning true for pre-defined apps
09-01 20:53:41.728 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:38): device: UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@41d25320], package: com.clover.seiko_lpt02_245 (10029), allowed? true
09-01 20:53:41.730 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:25): +call method: hasPermission
09-01 20:53:41.731 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:56): +isAllowed method: com.clover.seiko_lpt02_245 UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@41d54728]
09-01 20:53:41.732 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:74): returning true for pre-defined apps
09-01 20:53:41.732 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:38): device: UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@41d54728], package: com.clover.seiko_lpt02_245 (10029), allowed? true
09-01 20:53:41.952 19278-19294/? D/UsbDeviceConnectionJNI: close
09-01 20:53:41.952 19278-19294/? D/PrinterController: Printer disconnect
09-01 20:53:41.952 19278-19294/? D/PrinterController: Returning printer status: OK
09-01 20:53:41.982 1755-19273/? I/dalvikvm-heap: Grow heap (frag case) to 7.163MB for 918736-byte allocation
09-01 20:53:42.034 1755-1760/? D/dalvikvm: GC_CONCURRENT freed 502K, 87% free 5683K/41940K, paused 2ms+3ms, total 52ms
09-01 20:53:42.089 19278-19291/? I/dalvikvm-heap: Grow heap (frag case) to 3.856MB for 459376-byte allocation
09-01 20:53:42.108 19278-19291/? I/dalvikvm-heap: Grow heap (frag case) to 4.733MB for 918736-byte allocation
09-01 20:53:42.341 148-364/? D/AudioPolicyManagerBase: setOutputDevice() output 2 device 0000 delayMs 170
09-01 20:53:42.341 148-364/? D/AudioPolicyManagerBase: setOutputDevice() prevDevice 0002
09-01 20:53:43.657 1877-1882/? D/dalvikvm: GC_CONCURRENT freed 391K, 69% free 3403K/10780K, paused 2ms+2ms, total 18ms
09-01 20:53:53.089 19278-19291/? D/PrinterController: Printer connect
09-01 20:53:53.093 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:25): +call method: hasPermission
09-01 20:53:53.095 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:56): +isAllowed method: com.clover.seiko_lpt02_245 UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@4204b850]
09-01 20:53:53.096 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:74): returning true for pre-defined apps
09-01 20:53:53.097 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:38): device: UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@4204b850], package: com.clover.seiko_lpt02_245 (10029), allowed? true
09-01 20:53:53.100 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:25): +call method: hasPermission
09-01 20:53:53.102 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:56): +isAllowed method: com.clover.seiko_lpt02_245 UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@42062d30]
09-01 20:53:53.103 1755-19273/? I/UsbPermissionProvider: isAllowed(UsbPermissionProvider.java:74): returning true for pre-defined apps
09-01 20:53:53.103 1755-19273/? I/UsbPermissionProvider: call(UsbPermissionProvider.java:38): device: UsbDevice[mName=/dev/bus/usb/001/004,mVendorId=1561,mProductId=296,mClass=0,mSubclass=0,mProtocol=0,mInterfaces=[Landroid.os.Parcelable;@42062d30], package: com.clover.seiko_lpt02_245 (10029), allowed? true
09-01 20:53:53.107 19278-19291/? D/PrinterController: Printing bitmap...
09-01 20:53:54.923 19278-19291/? D/PrinterController: Print success: true
09-01 20:53:54.924 19278-19291/? D/UsbDeviceConnectionJNI: close
09-01 20:53:54.924 19278-19291/? D/PrinterController: Printer disconnect
3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

It should not take 10+ seconds to print something. Can you provide an isolated test case that shows the problem?

0 Likes 0 ·
pavan avatar image pavan commented ·

Hi @jeff i am trying to implement ViewPrintJob but din't find any example for same, is there any example available? here what i tried "new ViewPrintJob.Builder().view(view).build().print(this,mAccount,printer);" is it right approach?

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

No there's no sample. Please provide an MVCE that shows your problem.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community