最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - access web serial api in android chrome browser - Stack Overflow

programmeradmin2浏览0评论

using web serial API in windows, mac os, and Linux chrome browser I can receive and send data. but in the android chrome browser, I am not able to send or receive data from a serial device.

so which API is used to read and write data to serial devices in the android chrome browser.

also, there is a polyfill serial API for android chrome but is showing an error shown in the image.

using web serial API in windows, mac os, and Linux chrome browser I can receive and send data. but in the android chrome browser, I am not able to send or receive data from a serial device.

so which API is used to read and write data to serial devices in the android chrome browser.

also, there is a polyfill serial API for android chrome but is showing an error shown in the image.

Share Improve this question asked May 12, 2022 at 5:36 Tejas ChauhanTejas Chauhan 1091 gold badge3 silver badges13 bronze badges 5
  • 1 Are you aware of: caniuse./?search=serial – Morrison Chang Commented May 12, 2022 at 5:50
  • yes. I have read, that web serial API is not supported in android chrome. but is there another way to municate with a serial(USB-based) device from android chrome? because my PWA project requires access on both desktop and mobile. – Tejas Chauhan Commented May 12, 2022 at 6:18
  • Given that Android apps written in Java/Kotlin need/use a third-party library to support USB Serial: github./mik3y/usb-serial-for-android it is unlikely unless the browser has similar code. – Morrison Chang Commented May 12, 2022 at 6:34
  • okay!! thanks for answering! using this I have to build. APK file. using this I can municate to the serial device. – Tejas Chauhan Commented May 12, 2022 at 6:58
  • @TejasChauhan hi! I am reaching you just to know more on it, my project requirement make a web application for lungs function test machine which creates the live data for 4 secs as patients breathes using desktop application. By using this web serial API is it possible to capture uping live data on web client(browser) . Currently I ma in the POC phase would be great if you can answer it. – Shobhit Solanki Commented Jan 22, 2024 at 6:43
Add a ment  | 

1 Answer 1

Reset to default 4

The team that built the implementation of the Web Serial API in Chromium also wrote a polyfill library which uses WebUSB to support platforms which don't provide built-in serial drivers: https://github./google/web-serial-polyfill

It looks like you are already trying to use this library. Can you file an issue on the library's GitHub project so the team can look at the error you're seeing?

Note, it seems like there are some Android devices which have USB serial drivers that end up blocking WebUSB from claiming interfaces even though the platform doesn't let apps actually use them. https://crbug./1099521 is tracking a workaround for that.

发布评论

评论列表(0)

  1. 暂无评论