Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My guess is you're app probably establish the communication with a listener that looks for a connection just being made of the USB device. If the printer is already connected and your app is waiting on that listener, it will not happen since your call back function will not be called, the usb printer already being there before your app is running. This is a guess since I did not see your code but I saw that kind of behavior for that reason in other cases.</p> <p>EDIT after getting more info in the question. As I said in my comment, i believe the event lauching your app (the ...USB_DEVICE_ATTACHED) is not happenning if the device is already connected at boot time. To prove that, you should add a lot of traces with <a href="http://developer.android.com/tools/help/logcat.html" rel="nofollow">logcat (viewing)</a> and <a href="http://developer.android.com/tools/debugging/debugging-log.html" rel="nofollow">(writing)</a>in your code, inside your onCreate, onResume and may be elsewhere. Do that and you will see if each section perform what you expect. My guess is it's not executed at all when you boot and the USB device is already connected. If I understand what you want is this. When the device is being connected, you want to launch you app. But if the device is already there at boot time, you want your app to be launched anyway and connect to the USB. The way I would approach this is by having you app looking for the presence of the targeted USB device. The presence is different than the "USB_DEVICE_ATTACHED" which means it just got connected in the last few milliseconds. I would also register a listener on "USB_DEVICE_ATTACHED" that would launch your code on device connection and I would set also a listener on "BOOT_COMPLETED" to launch your app after your tablet booting sequence. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload