[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/ranging/DataNotificationConfig.Builder [Back]  [Original]

DataNotificationConfig.Builder  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

DataNotificationConfig.Builder


public static final class DataNotificationConfig.Builder
extends Object

java.lang.Object
   ↳ android.ranging.DataNotificationConfig.Builder


Builder for DataNotificationConfig

Summary

Public constructors

Builder()

Public methods

DataNotificationConfig build()

Builds a new instance of DataNotificationConfig.

DataNotificationConfig.Builder setNotificationConfigType(int config)

Sets the notification configuration type.

DataNotificationConfig.Builder setProximityFarCm(int proximityCm)

Sets the far proximity threshold in centimeters.

DataNotificationConfig.Builder setProximityNearCm(int proximityCm)

Sets the near proximity threshold in centimeters.

Inherited methods

Public constructors

Builder

Added in API level 36
public Builder ()

Public methods

build

Added in API level 36
public DataNotificationConfig build ()

Builds a new instance of DataNotificationConfig.

Returns
DataNotificationConfig a new DataNotificationConfig instance created using the current state of the builder.
This value cannot be null.

setNotificationConfigType

Added in API level 36
public DataNotificationConfig.Builder setNotificationConfigType (int config)

Sets the notification configuration type.

defaults to ERROR(NotificationConfigType.NOTIFICATION_CONFIG_ENABLE/android.ranging.DataNotificationConfig.NotificationConfigType#NOTIFICATION_CONFIG_ENABLE NotificationConfigType.NOTIFICATION_CONFIG_ENABLE)

Parameters
config int: The notification configuration type to set.
Value is one of the following:
Returns
DataNotificationConfig.Builder this Builder instance.
This value cannot be null.

setProximityFarCm

Added in API level 36
public DataNotificationConfig.Builder setProximityFarCm (int proximityCm)

Sets the far proximity threshold in centimeters.

defaults to 20000 cm.

Parameters
proximityCm int: The far proximity to set, in centimeters.
Value is between 0 and 20000 inclusive

Returns
DataNotificationConfig.Builder this Builder instance.
This value cannot be null.

setProximityNearCm

Added in API level 36
public DataNotificationConfig.Builder setProximityNearCm (int proximityCm)

Sets the near proximity threshold in centimeters.

defaults to 0 cm.

Parameters
proximityCm int: The near proximity to set, in centimeters.
Value is between 0 and 20000 inclusive

Returns
DataNotificationConfig.Builder this Builder instance.
This value cannot be null.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page