Search code examples
javafxjavafx-8gluon-mobile

Access device information with gluon


I was looking for accessing device information like current device WLAN MAC address, IMEI, OS type etc. using Gluon mobile. How can I do it?


Solution

  • Currently the Charm Down Device service provides some of the features you are requesting.

    • Model: device's model or product
    • Uuid: device's universally unique identifier
    • Platform: the platform string that the operating system uses to identify itself
    • Version: the version number of the device platform
    • Serial: the device hardware serial number.
    • Wearable: true if the device is a wearable

    In your view, you can call the service like:

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

    Also, you can find implementation details for android here and for iOS here.

    If there is any other feature you require, and you want to implement it, you can either clone and modify the service (see this question on how to do it), or create a new one (see this sample).