public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getLocalIpWithFilter()
Tries to get the IP, with the Filter specified in the config.
|
static Integer |
getSystemBatteryStatus()
Tries to get the battery status.
|
static void |
returnStaticBatteryLevel(boolean returnStatic)
Allows to manipulate the returned battery level which can be received by
getSystemBatteryStatus(). |
static void |
setStaticBatteryLevel(Integer level)
Sets a static battery value.
|
static boolean |
systemHasBattery()
Checks if the given system has a battery.
|
public static void returnStaticBatteryLevel(boolean returnStatic)
getSystemBatteryStatus().
If set to true, a static value is returned by getSystemBatteryStatus(). The static value can be set via
#setStaticBatteryLevel().
If set to true, it also affects the value received by systemHasBattery(), so always true is returned.
Default static battery level is staticBatteryLevel.returnStatic - public static void setStaticBatteryLevel(Integer level)
returnStaticBatteryLevel(boolean) must be set to true, to return the static value.level - public static String getLocalIpWithFilter()
Inet4Address.getLocalHost().getHostAddress() is returned.public static Integer getSystemBatteryStatus()
public static boolean systemHasBattery()
Copyright © 2018. All rights reserved.