使用 gluon 访问设备信息

Access device information with gluon

我正在寻找使用 Gluon 移动设备访问设备信息,例如当前设备 WLAN MAC 地址、IMEI、OS 类型等。我该怎么做?

目前 Charm Down Device service 提供了您要求的一些功能。

  • 型号:设备的型号或产品
  • Uuid:设备的全球唯一标识符
  • Platform:操作系统用来标识自身的平台字符串
  • 版本:设备平台的版本号
  • Serial:设备硬件序列号。
  • 可穿戴设备:如果设备是可穿戴设备则为真

在您看来,您可以像这样调用服务:

Services.get(DeviceService.class).ifPresent(service -> {
    System.out.printf("Device Model Name: %s", service.getModel());
});

此外,您还可以找到 android here and for iOS here.

的实施细节

如果您需要任何其他功能,并且想要实现它,您可以克隆和修改该服务(请参阅此 on how to do it), or create a new one (see this sample)。