简体   繁体   English

从浏览器检测到USB连接的手机?

[英]Detect usb connected phone from browser?

Is it possible to detect a usb connected phone from a browser? 是否可以通过浏览器检测USB连接的电话? And be able to call the phones functions like sms via javascript? 并能够通过javascript调用短信之类的电话功能?

Side Question: Is it possible with Chrome Apps USB API? 附加问题: Chrome Apps USB API是否可以?

In nearly all cases, no. 在几乎所有情况下,都不是。 The USB connection usually only supports file transfers. USB连接通常仅支持文件传输。

Accessing the OS and phone features like SMS even for an app is usually either explicitly prohibited or requires certain developer permissions be enabled by the user. 通常甚至明确禁止访问OS和电话功能(例如SMS)甚至是应用程序,或者要求用户启用某些开发人员权限。 Accessing SMS on an iPhone, for example, is not even possible for installed apps. 例如,对于已安装的应用程序,甚至无法访问iPhone上的SMS。 The user must interact with the device to send. 用户必须与设备交互才能发送。

Even when advanced USB options are enabled and you're targeting a device that would allow an installed app to send an SMS without user interaction, it still is difficult and you need software installed on the computer where the phone is connected (not just a standard USB driver for the phone). 即使启用了高级USB选项并且您定位的设备将允许已安装的应用无需用户交互即可发送SMS,但这仍然很困难,并且您需要在连接手机的计算机上安装软件(不仅仅是标准设备)手机的USB驱动程序)。 For example with Android: 以Android为例:

http://forum.processing.org/two/discussion/1355/send-sms-to-an-android-phone-with-adb/p1 http://forum.processing.org/two/discussion/1355/send-sms-to-an-android-phone-with-adb/p1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM