I'm intended to program an interface with HTML/JAVASCRIPT/jQuery to control an electronic device. The communication must be via Bluetooth (there's already an instruction set to control the device in existence, and the device is already Bluetooth-capable), and this interface should be portable to an android app via Phonegap...
so I would love to get some advice in how to establish a Bluetooth communication with HTML or JAVASCRIPT, and to port it via Phonegap... tutorials, books, or whatever kind of hint will be warmly wellcomed!
Quick answer: You have to write your own cordova/phonagap plugin.
Longer answer:
The only way to establish communication between HTML and native phone API within cordova/phonegap is to use Phonegap Plugin API. The plugin API works as a bridge between the phone and the browser JS.
You have to write native code for you target platforms and JS.
The most tricky part is to unify the handling of different native APIs from the different mobile platforms on the JS site. For a single targeted platform the complexity is quite manageable.
Phonegap has an github page with almost all available plugins open sourced. You could use them as examples. There are also some tutorials available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With