0

Is it possible that -

  • We scan a Bar-code by using Android device camera
  • Then plugging USB with a desktop
  • Passing the scanned Bar-code data from Mobile to PC
  • And filling a web-form opened in a browser in the desktop by using the data arriving through USB

If this is possible, can anyone suggest me how to implement this one? I have been looking for some solutions but those works only in mobile.

Shunjid Rahman
  • 409
  • 5
  • 17

2 Answers2

1

Yes, i recomand xZing librabry: https://github.com/zxing/zxing for barcode scanner . Use the barcode scanner to write into a .txt How to Read/Write String from a File in Android or .csv How to export data to csv file in Android? file wich you can copy in your desktop. For the last part i don't have an answer..

1

If you want to use an Android device camera, you don't need to connect the device to the USB port. Not like a webcam, there's no driver for opening Android camera straightforward on PC.

A possible workaround:

  1. Use WebSocket for communication between the desktop browser (E.g. desktop.htm) and the mobile browser (E.g. mobile.htm).
  2. Use WebRTC (getUserMedia) to open Android camera in the mobile browser.
  3. Embed a JavaScript barcode SDK (E.g. ZXing or Dynamsoft JavaScript Barcode SDK) into your mobile web app.
  4. Read barcodes and sync results from mobile.htm to desktop.htm via WebSocket.
yushulx
  • 11,695
  • 8
  • 37
  • 64