Package com.blukii.sdk.common
Klasse FeatureValidator
java.lang.Object
com.blukii.sdk.common.FeatureValidator
Helper class to validate application and mobile device features.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanChecks if Bluetooth is enabled on the device.booleanChecks if the device is connected to any (public or local) Network.booleanChecks if the App is on foreground.booleanChecks if the device is connected to the internet.booleanChecks if the device screen is interactive.booleanChecks if Location is enabled on the device.
-
Konstruktordetails
-
FeatureValidator
public FeatureValidator(@NonNull android.content.Context context) Constructor- Parameter:
context- a valid context that must not be null
-
-
Methodendetails
-
isAppOnForeground
public boolean isAppOnForeground()Checks if the App is on foreground.- Gibt zurück:
trueif App is on foreground
-
isScreenOn
public boolean isScreenOn()Checks if the device screen is interactive.Note: if the device is on lock screen this function will return
false- Gibt zurück:
trueif Screen is interactive
-
isConnectedToInternet
@RequiresPermission("android.permission.ACCESS_NETWORK_STATE") public boolean isConnectedToInternet()Checks if the device is connected to the internet.- Gibt zurück:
trueif connected to the internet
-
hasNetworkConnection
@RequiresPermission("android.permission.ACCESS_NETWORK_STATE") public boolean hasNetworkConnection()Checks if the device is connected to any (public or local) Network.- Gibt zurück:
trueif connected to any Network
-
bluetoothIsEnabled
@RequiresPermission("android.permission.BLUETOOTH") public boolean bluetoothIsEnabled()Checks if Bluetooth is enabled on the device.Note: Requires
Manifest.permission.BLUETOOTHpermission.- Gibt zurück:
trueif Bluetooth is enabled
-
locationIsEnabled
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION") public boolean locationIsEnabled()Checks if Location is enabled on the device.Note: Requires
Manifest.permission.ACCESS_FINE_LOCATIONpermission.- Gibt zurück:
trueif Location is enabled
-