简体   繁体   中英

Detect usb connected phone from browser?

Is it possible to detect a usb connected phone from a browser? And be able to call the phones functions like sms via javascript?

Side Question: Is it possible with Chrome Apps USB API?

In nearly all cases, no. The USB connection usually only supports file transfers.

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. Accessing SMS on an iPhone, for example, is not even possible for installed apps. 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). For example with Android:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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