-
- All Known Implementing Classes:
AndroidDeviceService
,IOSDeviceService
public interface DeviceService
The device service provides generic properties of the device on which the application is running.Example
Services.get(DeviceService.class).ifPresent(service -> { System.out.printf("Device Model Name: %s", service.getModel()); });
Android Configuration: none
iOS Configuration: none
- Since:
- 3.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.util.Optional<DeviceService>
create()
Returns an instance ofDeviceService
.java.lang.String
getModel()
Returns the name of the device's model or product.java.lang.String
getPlatform()
Returns the platform string that the operating system uses to identify itself.java.lang.String
getUuid()
Returns the device's universally unique identifier.java.lang.String
getVersion()
Returns the version number of the device platform.boolean
isWearable()
Returns true if the device is a wearable
-
-
-
Method Detail
-
create
static java.util.Optional<DeviceService> create()
Returns an instance ofDeviceService
.- Returns:
- An instance of
DeviceService
.
-
getModel
java.lang.String getModel()
Returns the name of the device's model or product. The value is set by the device manufacturer and may be different across versions of the same product.- Returns:
- The device model.
-
getUuid
java.lang.String getUuid()
Returns the device's universally unique identifier.- Returns:
- The device UUID.
-
getPlatform
java.lang.String getPlatform()
Returns the platform string that the operating system uses to identify itself.- Returns:
- The device platform.
-
getVersion
java.lang.String getVersion()
Returns the version number of the device platform.- Returns:
- The device version.
-
isWearable
boolean isWearable()
Returns true if the device is a wearable- Returns:
- true if the device is a wearable
- Since:
- 3.3.0
-
-