public enum NearbyPermission

  1. Object
  2. Enum<NearbyPermission>
  3. NearbyPermission

ImplementsComparable<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 constants

RANGINGPrecision ranging.
DISCOVERYDiscovering nearby devices to advertise to or range against.
ADVERTISEAdvertising this device so others can find it.
CONNECTConnecting to a discovered device and moving payloads.

Methods

public static NearbyPermission[] values()
public static NearbyPermission valueOf(String name)

Inherited methods

Enum constant details

RANGING

RANGING
Precision ranging. Android UWB_RANGING; on iOS the Nearby Interaction authorization prompted by the first session.

DISCOVERY

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

CONNECT
Connecting to a discovered device and moving payloads. Android BLUETOOTH_CONNECT; no iOS equivalent.

Method details

values

public static NearbyPermission[] values()

valueOf

public static NearbyPermission valueOf(String name)