-2

I am thinking of creating a PWA application in VAADIN and i would like to access the Phone's bluetooth. And i dont find in their documentation any sources to do this. Is this possible?

Your help will be appreciated! Thank you!

  • From a quick google search: [seems its not possible with the standard api](https://vaadin.com/forum/thread/16551817) – Lino Feb 20 '19 at 08:11

2 Answers2

1

There is some ways to do this but the browser support is limited (mostly only Chrome with Android at the moment I think). HTML5 has some specs for accessing Bluetooth or Camera.

There are some add-ons for Vaadin 10+, i.e. Flow in Vaadin Directory, which use these specs

See the links for more details.

https://vaadin.com/directory/component/webbluetooth-printer

https://vaadin.com/directory/component/vcamera

Tatu Lund
  • 9,949
  • 1
  • 12
  • 26
0

The RapidClipse framework provides a Java mobile API that enables Vaadin developers to access to many native hardware and systems functions of mobile devices. The API uses Cordova under the hood, which is a native-browser bridge. The RapidClipse API extends Cordova with a Java API for Vaadin, that allows you to access to Cordova functions by calling Java methods, so you don't get in contact with JavaScript.

With this API have access to: Device info, device buttons, accelerometer, vibration, geolocation, compass, user contacts, local file system, barcode scanner, camera, NFC, bluetooth and allows to send SMS.

Example:

 /**
 * Add a button handler, e.g. for the back button
 */
AppService.getInstance().addBackButtonHandler(event->{
    // Do something ...
    // and consume event so that it will not be processed in the default manner by the source which originated it.   
    event.consume();
});

Supported features: http://www.rapidclipse.com/en/Framework.html

Doc: https://rapidclipse.atlassian.net/wiki/spaces/DOCEN/pages/50659630/XDEV+Mobile+Kit

The RapidClipse framework is open source.