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

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.health.connect.datatypes.Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) |

## Summary

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

| Public methods ||
|---|---|
| [Device](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#build()()` Build and return `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device` object |
| [Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#setDisplayName(kotlin.String)(displayName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` Sets an optional display name for the device |
| [Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#setManufacturer(kotlin.String)(manufacturer: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` Sets an optional client supplied manufacturer of the device |
| [Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#setModel(kotlin.String)(model: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` Sets an optional client supplied model of the device |
| [Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#setType(kotlin.Int)(type: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets an optional client supplied type of the device |
| [Device.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#setUdi(kotlin.String)(udi: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` 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/kotlin/android/health/connect/datatypes/Device` instance. |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): Device
```

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

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device` | This value cannot be `null`. |

### setDisplayName

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

```
fun setDisplayName(displayName: String?): Device.Builder
```

Sets an optional display name for the device

| Parameters ||
|---|---|
| `displayName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#` | This value cannot be `null`. |

### setManufacturer

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

```
fun setManufacturer(manufacturer: String?): Device.Builder
```

Sets an optional client supplied manufacturer of the device

| Parameters ||
|---|---|
| `manufacturer` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#` | This value cannot be `null`. |

### setModel

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

```
fun setModel(model: String?): Device.Builder
```

Sets an optional client supplied model of the device

| Parameters ||
|---|---|
| `model` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#` | This value cannot be `null`. |

### setType

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

```
fun setType(type: Int): Device.Builder
```

Sets an optional client supplied type of the device

| Parameters ||
|---|---|
| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is one of the following: - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_UNKNOWN:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_WATCH:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_PHONE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_SCALE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_RING:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_HEAD_MOUNTED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_BAND:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_CHEST_STRAP:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_SMART_DISPLAY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_CONSUMER_MEDICAL_DEVICE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_GLASSES:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_HEARABLE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_MACHINE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_FITNESS_EQUIPMENT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_PORTABLE_COMPUTER:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device#DEVICE_TYPE_METER:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#` | This value cannot be `null`. |

### setUdi

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

```
fun setUdi(udi: String?): Device.Builder
```

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/kotlin/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's Global Unique Device Identification Database (GUDID).
- In the EU, it is the European Database on Medical Devices (EUDAMED).

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

| Parameters ||
|---|---|
| `udi` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/Device.Builder#` | This value cannot be `null`. |