Using Java to communicate to a USB device from browser - usb

We have a java web application and now we have a new request: the client wants to communicate with their USB device using our application. They plug the device into their PCs, open a page of our web application and the page will communicate with the device to get some input. Communication here means reading some input from the device. This should be support on every script supported browser. Can someone give me a guide or a link that tells me how to do it? Thank you for reading.

You can use the WebUSB API to communicate with USB devices in the Web app. However, WebUSB is only implemented in Chromium.

Related

There is no prompt to select USB device using navigator.usb.requestDevice() on Zebra Enterprise Browser

I am trying to use Web USB API to communicate with USB relay. The web page is running on Zebra device. It is working fine in Chromium. I am getting a prompt to select USB device.
device = await navigator.usb.requestDevice({ filters: [{ vendorId: config.VENDOR_ID, productId: config.PRODUCT_ID }] });
The Zebra device comes with Enterprise Browser. It is similar to Chromium. But I do not get the prompt to select USB device when running the same web page in Enterprise Browser.
Does anyone know how to get this working in the Enterprise Browser?
Or is there any way that navigator.usb.requestDevice() returns the device without user's action?
Thank you.
I recommend reaching out to Zebra's support channels with questions about their browser. Even if it is based on Chromium it may not include or have disabled components of the WebUSB implementation.
The WebUsbAllowDevicesForUrls enterprise policy allows an administrator to pre-grant permission for a site to access USB devices but that depends on the browser having the complete WebUSB and enterprise policy engine from the upstream Chromium project so there's no guarantee that it will work without reaching out to Zebra.
Zebra Enterprise Browser may be based on Android WebView instead of Chromium. While Android WebView is itself based on Chromium it doesn't include the code necessary to support the WebUSB API. Adding support for WebUSB to Android WebView is tracked by Chromium's issue 933055.

Stream video from a stand alone desktop application(not browser) to a remote desktop application(not browser)

I'm trying to build a live video streaming application from a usb camera to an application running on a remote desktop. I've researched protocols like RTMP, RTSP, WebRTC. According to my understanding I can't use webRTC since it's only compatible in the browser and I'm not building my application for a browser here. Please help me choose the right protocol and also the media server.
You can, and many applications do, use WebRTC outside the browser. WebRTC implementations are available for many different platforms including iOS, Android and embedded systems.
You can even use Headless Chrome if you want to use the Chrome APIs without the visual parts of the browser.

USB device listening OSX objective c using peertalk

I developed a OSX application that listening the USB devices that connected from OSX and application runs fine before submit to app store. At the time of submission to app store I enabled the "App Sandbox" and enabled USB in App Sandbox. But after enable this application is not able to get the list of USB connected devices. I am using peertalk library from github. Link is below:
PeerTalk
So now please can anyone suggest the solution for this. or suggest any option to get the devices list which is connected from osx using USB.
Thanks
Mit

What is the exact function of an USB driver?

On reading many websites, I got confused.
Is the USB driver essential for making the device work? Or is it essential for making it communicate with the OS to do functions such as printing and doing other OS stuff?
To explain my question more clearly -
I am working on developing a USB device, that will communicate with the software i will write.
Do I need to develop a driver for such a system?
or
Do I just need the software program to send the proper messages to the device?
I am assuming your micro controller will be a USB device and your PC will be USB host.
The below diagram is the SW architecture for USB host. Now since your host is a PC, you do not need to worry about any part except the application at the top.
So lets talk about the device. What you need is a device stack which resembles with the host stack below. You can get the device stack easily and port it in your micro controller. But I suppose you need an application in your device too same as the top box of the below diagram which will understand the requests from the host and service the request.
So basically what I am saying that you need two applications and the rest of the components you can get it with some effort.
Regards.

Interact with USB storage device from web page directly or using communication to native applications

I already had an Java application that is downloaded as part of java applets from the web page, that can interact with the USB Storage device where it need to save and retrieve data from the device.
Since the chrome has stopped supporting out of sandbox running applets, I need to develop some new technique to interact with the USB Storage Device from my web page. My application architect does not want to achieve same using JNLP which is one options that I have learnt by reading some articles.
Now I would like you peoples to help me on build some applications, so that I can use the same in my webpage to access USB storage device(Pen drive) independent of OS (Operating System) and Independent of Browser(Cross browser support-mostly should work on IE, firefox , chrome and safari).
I am ok with application build on native (OS dependent), but should be there a way to communicate with that application from any browsers installed over that machine.