# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# RangingRequest.Builder

`public static final class RangingRequest.Builder`
`extends Object` ``

java.lang.Object
↳ | android.net.wifi.rtt.RangingRequest.Builder

Builder class used to construct `RangingRequest` objects.

## Summary

### Public constructors
`Builder()`

### Public methods
`RangingRequest.Builder` | `addAccessPoint(ScanResult apInfo)` Add the device specified by the `ScanResult` to the list of devices with which to measure range.
`RangingRequest.Builder` | `addAccessPoints(List<ScanResult> apInfos)` Add the devices specified by the `ScanResult`s to the list of devices with which to measure range.
`RangingRequest.Builder` | `addWifiAwarePeer(MacAddress peerMacAddress)` Add the device specified by the `peerMacAddress` to the list of devices with which to measure range.
`RangingRequest.Builder` | `addWifiAwarePeer(PeerHandle peerHandle)` Add a device specified by a `PeerHandle` to the list of devices with which to measure range.
`RangingRequest` | `build()` Build `RangingRequest` given the current configurations made on the builder.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder ()

## Public methods

### addAccessPoint

    public RangingRequest.Builder addAccessPoint (ScanResult apInfo)

Add the device specified by the `ScanResult` to the list of devices with which to measure range. The total number of peers added to a request cannot exceed the limit specified by `RangingRequest.getMaxPeers()`.

Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use `ScanResult#is80211mcResponder()` to verify the Access Point's capabilities. If not supported the result status will be `RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC`.

Parameters
`apInfo` | `ScanResult`: Information of an Access Point (AP) obtained in a Scan Result. This value cannot be `null`.

Returns
`RangingRequest.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`.

### addAccessPoints

    public RangingRequest.Builder addAccessPoints (List<ScanResult> apInfos)

Add the devices specified by the `ScanResult`s to the list of devices with which to measure range. The total number of peers added to a request cannot exceed the limit specified by `RangingRequest.getMaxPeers()`.

Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use `ScanResult#is80211mcResponder()` to verify the Access Point's capabilities. If not supported the result status will be `RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC`.

Parameters
`apInfos` | `List`: Information of an Access Points (APs) obtained in a Scan Result. This value cannot be `null`.

Returns
`RangingRequest.Builder` | The builder to facilitate chaining `builder.setXXX(..).setXXX(..)`.

### addWifiAwarePeer

    public RangingRequest.Builder addWifiAwarePeer (MacAddress peerMacAddress)

Add the device specified by the `peerMacAddress` to the list of devices with which to measure range.

The MAC address may be obtained out-of-band from a peer Wi-Fi Aware device. A Wi-Fi Aware device may obtain its MAC address using the `IdentityChangedListener` provided to `WifiAwareManager#attach(AttachCallback, IdentityChangedListener, Handler)`.

Note: in order to use this API the device must support Wi-Fi Aware `android.net.wifi.aware`. The peer device which is being ranged to must be configured to publish a service (with any name) with:

- Type `PublishConfig.PUBLISH_TYPE_UNSOLICITED`.
- Ranging enabled `PublishConfig.Builder.setRangingEnabled(boolean)`.

  Parameters
  `peerMacAddress` | `MacAddress`: The MAC address of the Wi-Fi Aware peer. This value cannot be `null`.

  Returns
  `RangingRequest.Builder` | The builder, to facilitate chaining `builder.setXXX(..).setXXX(..)`.

### addWifiAwarePeer

    public RangingRequest.Builder addWifiAwarePeer (PeerHandle peerHandle)

Add a device specified by a `PeerHandle` to the list of devices with which to measure range.

The `PeerHandle` may be obtained as part of the Wi-Fi Aware discovery process. E.g. using `DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)`.

Note: in order to use this API the device must support Wi-Fi Aware `android.net.wifi.aware`. The peer device which is being ranged to must be configured to publish a service (with any name) with:

- Type `PublishConfig.PUBLISH_TYPE_UNSOLICITED`.
- Ranging enabled `PublishConfig.Builder.setRangingEnabled(boolean)`.

  Parameters
  `peerHandle` | `PeerHandle`: The peer handler of the peer Wi-Fi Aware device. This value cannot be `null`.

  Returns
  `RangingRequest.Builder` | The builder, to facilitate chaining `builder.setXXX(..).setXXX(..)`.

### build

    public RangingRequest build ()

Build `RangingRequest` given the current configurations made on the builder.

Returns
`RangingRequest` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*