public static class

StartBleScanRequest.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.fitness.request.StartBleScanRequest.Builder

Class Overview

Builder used to create new DataSourceRequests.

Summary

Public Constructors
StartBleScanRequest.Builder()
Public Methods
StartBleScanRequest build()
Finishes building and returns the request.
StartBleScanRequest.Builder setBleScanCallback(BleScanCallback bleScanCallback)
Sets the callback to be used when devices are found.
StartBleScanRequest.Builder setDataTypes(DataType... dataTypes)
Sets the desired data types to search for on the BLE scan.
StartBleScanRequest.Builder setTimeoutSecs(int stopTimeSecs)
Sets how long to wait before automatically stopping the scan, in seconds.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StartBleScanRequest.Builder ()

Public Methods

public StartBleScanRequest build ()

Finishes building and returns the request.

Throws
IllegalStateException if the builder doesn't have enough data to build a valid request

public StartBleScanRequest.Builder setBleScanCallback (BleScanCallback bleScanCallback)

Sets the callback to be used when devices are found. The callback must be set or build() will throw an exception.

Parameters
bleScanCallback the callback to be called.

public StartBleScanRequest.Builder setDataTypes (DataType... dataTypes)

Sets the desired data types to search for on the BLE scan. We'll only return devices which match this data type. If no data types are set, the request will return all compatible devices.

Parameters
dataTypes the data types to search for. These can be one of the data types listed in DataType, or a custom data type.

public StartBleScanRequest.Builder setTimeoutSecs (int stopTimeSecs)

Sets how long to wait before automatically stopping the scan, in seconds. If this method isn't called scans will stop after 10 seconds by default.

Parameters
stopTimeSecs duration of the scan before stopping. Must be a value between 1 and 60 seconds.