Vaadin with Web Bluetooth ?

Hi all,
Is it possible to get vaadin to work with Web Bluetooth ?.
https://webbluetoothcg.github.io/web-bluetooth/

Thanks

Hi,
I don’t know these API, but I think you could integrate it with Vaadin implementing a javascript
component
.

HTH
Marco

Thanks Marco,

I mean some Vaadin libraries that support Bluetooth, so we can write directly in Java code instead of javascript.

Hi,
Vaadin has no OOB support for Web Bluetooth API, and I’ve not found any addon available,
What I mean with “javascript component” is a server side Vaadin Java component that can easilly interact with javascript via RPC calls.
Check out the classes
AbstractJavaScriptComponent
and
AbstractJavaScriptExtension
.

In the java class you can add functions that you can call from javascript and that would be execute on server (method addFunction) and call client side javascriot functions defined on your js connector (method callFuntion).
In addition you can also use a State object to share data between server side and client side (but remember that this flows only from server to client, not on the opposite way)

If you want to see an example this is a Vaadin addon that gives you Java components that interact with Twitter javascript API


https://github.com/mcollovati/vaadin-twitter-widgets

HTH
Marco

Hi Marco.

Thanks. Very useful info.