Class FeatureValidator

java.lang.Object
com.blukii.sdk.common.FeatureValidator

public final class FeatureValidator extends Object
Helper class to validate application and mobile device features.
  • Constructor Details

    • FeatureValidator

      public FeatureValidator(@NonNull android.content.Context context)
      Constructor
      Parameters:
      context - a valid context that must not be null
  • Method Details

    • isAppOnForeground

      public boolean isAppOnForeground()
      Checks if the App is on foreground.
      Returns:
      true if 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

      Returns:
      true if Screen is interactive
    • isConnectedToInternet

      @RequiresPermission("android.permission.ACCESS_NETWORK_STATE") public boolean isConnectedToInternet()
      Checks if the device is connected to the internet.
      Returns:
      true if 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.
      Returns:
      true if connected to any Network
    • bluetoothIsEnabled

      @RequiresPermission("android.permission.BLUETOOTH") public boolean bluetoothIsEnabled()
      Checks if Bluetooth is enabled on the device.

      Note: Requires Manifest.permission.BLUETOOTH permission.

      Returns:
      true if 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_LOCATION permission.

      Returns:
      true if Location is enabled