Enum NearbyPermission

java.lang.Object
java.lang.Enum<NearbyPermission>
com.codename1.nearby.NearbyPermission
All Implemented Interfaces:
Comparable<NearbyPermission>

public enum NearbyPermission extends Enum<NearbyPermission>

The runtime permissions the com.codename1.nearby APIs may need, named by what the app is trying to do rather than by any one platform's permission string.

Each entry point takes these as varargs in its requestPermissions method and maps them to whatever the running platform actually asks for: on Android a set of manifest permissions, on iOS an authorization prompt raised by the first call that needs it. A port that needs no permission for a given constant reports it granted rather than failing.

  • Enum Constant Details

    • RANGING

      public static final NearbyPermission RANGING
      Precision ranging. Android UWB_RANGING; on iOS the Nearby Interaction authorization prompted by the first session.
    • DISCOVERY

      public static final NearbyPermission DISCOVERY
      Discovering nearby devices to advertise to or range against. Android BLUETOOTH_SCAN plus NEARBY_WIFI_DEVICES (or location below API 33); on iOS the local network authorization.
    • CONNECT

      public static final NearbyPermission CONNECT
      Connecting to a discovered device and moving payloads. Android BLUETOOTH_CONNECT; no iOS equivalent.
  • Method Details

    • values

      public static NearbyPermission[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static NearbyPermission valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null