[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress [Back]  [Original]

BluetoothDevice.BluetoothAddress  |  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.

BluetoothDevice.BluetoothAddress


public static final class BluetoothDevice.BluetoothAddress
extends Object implements Parcelable

java.lang.Object
   ↳ android.bluetooth.BluetoothDevice.BluetoothAddress


A data class for Bluetooth address and address type.

Summary

Inherited constants

Fields

public static final Creator<BluetoothDevice.BluetoothAddress> CREATOR

Parcelable.Creator interface implementation.

Public constructors

BluetoothAddress(String address, int addressType)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String getAddress()

Returns the address of this BluetoothAddress.

int getAddressType()

Returns the address type of this BluetoothAddress, one of BluetoothDevice.ADDRESS_TYPE_PUBLIC, BluetoothDevice.ADDRESS_TYPE_RANDOM, or BluetoothDevice.ADDRESS_TYPE_UNKNOWN.

void writeToParcel(Parcel out, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 36
public static final Creator<BluetoothDevice.BluetoothAddress> CREATOR

Parcelable.Creator interface implementation.

Public constructors

BluetoothAddress

Added in API level 36
public BluetoothAddress (String address, 
                int addressType)

Parameters
address String: This value may be null.

addressType int: Value is one of the following:

Public methods

describeContents

Added in API level 36
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getAddress

Added in API level 36
public String getAddress ()

Returns the address of this BluetoothAddress.

For example, "00:11:22:AA:BB:CC".

Returns
String Bluetooth address as string.
This value may be null.

getAddressType

Added in API level 36
public int getAddressType ()

Returns the address type of this BluetoothAddress, one of BluetoothDevice.ADDRESS_TYPE_PUBLIC, BluetoothDevice.ADDRESS_TYPE_RANDOM, or BluetoothDevice.ADDRESS_TYPE_UNKNOWN.

Returns
int Bluetooth address type.
Value is one of the following:

writeToParcel

Added in API level 36
public void writeToParcel (Parcel out, 
                int flags)

Flatten this object in to a Parcel.

Parameters
out Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

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