我正在考虑在vaadin创建PWA应用程序,我想访问手机的蓝牙。而且我在他们的文档中找不到任何来源的来源。这可能吗?
您的帮助将不胜感激!谢谢!
有一些方法可以做到这一点,但是浏览器支持是有限的(我认为目前仅使用Android的Chrome)。HTML5有一些用于访问蓝牙或相机的规格。
vaadin 10 有一些附加组件,即vaadin目录中的流量,使用这些规格
有关更多详细信息,请参见链接。
https://vaadin.com/directory/component/webbluetooth-printer
https://vaadin.com/directory/component/vcamera
RapidClipse框架提供了Java移动API,使Vaadin开发人员能够访问移动设备的许多本机硬件和系统功能。API在引擎盖下使用Cordova,这是本地浏览器桥。RapidClipse API使用Vaadin的Java API扩展了Cordova,该API允许您通过调用Java方法访问Cordova功能,因此您不与JavaScript联系。
使用此API可以访问:设备信息,设备按钮,加速度计,振动,地理位置,指南针,用户联系人,本地文件系统,条形码扫描仪,相机,NFC,NFC,蓝牙,并允许发送SMS。
示例:
/**
* 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();
});
支持的功能:http://www.rapidclipse.com/en/framework.html
doc:https://rapidclipse.atlassian.net/wiki/spaces/docen/pages/50659630/xdev mobile kit
RapidClipse框架是开源的。