Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions) Summary: [Ctors](https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#inhmethods)

# Device.Builder

*** ** * ** ***


`
public
static
final

class
Device.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.health.connect.datatypes.Device.Builder |

<br />

*** ** * ** ***

**See also:**

- `https://developer.android.com/reference/android/health/connect/datatypes/Device`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#build()() ` Build and return `https://developer.android.com/reference/android/health/connect/datatypes/Device` object |
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#setDisplayName(java.lang.String)(https://developer.android.com/reference/java/lang/String displayName) ` Sets an optional display name for the device |
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#setManufacturer(java.lang.String)(https://developer.android.com/reference/java/lang/String manufacturer) ` Sets an optional client supplied manufacturer of the device |
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#setModel(java.lang.String)(https://developer.android.com/reference/java/lang/String model) ` Sets an optional client supplied model of the device |
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#setType(int)(int type) ` Sets an optional client supplied type of the device |
| ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | ` https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder#setUdi(java.lang.String)(https://developer.android.com/reference/java/lang/String udi) ` Sets an optional client supplied UDI (Unique Device Identifier), a unique numeric or alphanumeric code assigned to a medical device, for this `https://developer.android.com/reference/android/health/connect/datatypes/Device` instance. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Builder

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
public Builder ()
```

<br />

<br />

## Public methods

### build

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
public Device build ()
```

Build and return `https://developer.android.com/reference/android/health/connect/datatypes/Device` object

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device` | This value cannot be `null`. <br /> |

### setDisplayName

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 22](https://developer.android.com/sdkExtensions)

```
public Device.Builder setDisplayName (String displayName)
```

Sets an optional display name for the device

<br />

| Parameters ||
|---|---|
| `displayName` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | This value cannot be `null`. <br /> |

### setManufacturer

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
public Device.Builder setManufacturer (String manufacturer)
```

Sets an optional client supplied manufacturer of the device

<br />

| Parameters ||
|---|---|
| `manufacturer` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | This value cannot be `null`. <br /> |

### setModel

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
public Device.Builder setModel (String model)
```

Sets an optional client supplied model of the device

<br />

| Parameters ||
|---|---|
| `model` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | This value cannot be `null`. <br /> |

### setType

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
public Device.Builder setType (int type)
```

Sets an optional client supplied type of the device

<br />

| Parameters ||
|---|---|
| `type` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_UNKNOWN` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_WATCH` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_PHONE` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_SCALE` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_RING` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_HEAD_MOUNTED` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_BAND` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_CHEST_STRAP` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_SMART_DISPLAY` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_CONSUMER_MEDICAL_DEVICE` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_GLASSES` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_HEARABLE` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_MACHINE` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_EQUIPMENT` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_PORTABLE_COMPUTER` - `https://developer.android.com/reference/android/health/connect/datatypes/Device#DEVICE_TYPE_METER` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | This value cannot be `null`. <br /> |

### setUdi

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [U Extensions 23](https://developer.android.com/sdkExtensions)

```
public Device.Builder setUdi (String udi)
```

Sets an optional client supplied UDI (Unique Device Identifier), a unique numeric or
alphanumeric code assigned to a medical device, for this `https://developer.android.com/reference/android/health/connect/datatypes/Device` instance.

A device receives a UDI from an accredited issuing agency (e.g. from GS1) which is
then registered in multiple regulatory databases (e.g. FDA). The UDI is a unique,
globally recognized identifier assigned to a specific device model. An accredited issuing
agency, like GS1, provides the global standards used to create the UDI codes. The
manufacturers must submit the UDI provided by GS1 to the relevant regulatory databases
for each market they operate in.

- In the US, this is the FDA\\u2019s Global Unique Device Identification Database (GUDID).
- In the EU, it is the European Database on Medical Devices (EUDAMED).

The calling package needs to declare `https://developer.android.com/` in
manifest to be able to set UDI for any record. `https://developer.android.com/reference/java/lang/SecurityException` is thrown when
upserting a record with UDI without the permission.

<br />

| Parameters ||
|---|---|
| `udi` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/health/connect/datatypes/Device.Builder` | This value cannot be `null`. <br /> |