Device.Builder


public static final class Device.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.Device.Builder


See also:

Summary

Public constructors

Builder()

Public methods

Device build()

Build and return Device object

Device.Builder setDisplayName(String displayName)

Sets an optional display name for the device

Device.Builder setManufacturer(String manufacturer)

Sets an optional client supplied manufacturer of the device

Device.Builder setModel(String model)

Sets an optional client supplied model of the device

Device.Builder setType(int type)

Sets an optional client supplied type of the device

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 Device instance.

Inherited methods

Public constructors

Builder

Added in API level 34
Also in U Extensions 7
public Builder ()

Public methods

build

Added in API level 34
Also in U Extensions 7
public Device build ()

Build and return Device object

Returns
Device This value cannot be null.

setDisplayName

Added in API level 37
Also in U Extensions 22
public Device.Builder setDisplayName (String displayName)

Sets an optional display name for the device

Parameters
displayName String: This value may be null.

Returns
Device.Builder This value cannot be null.

setManufacturer

Added in API level 34
Also in U Extensions 7
public Device.Builder setManufacturer (String manufacturer)

Sets an optional client supplied manufacturer of the device

Parameters
manufacturer String: This value may be null.

Returns
Device.Builder This value cannot be null.

setModel

Added in API level 34
Also in U Extensions 7
public Device.Builder setModel (String model)

Sets an optional client supplied model of the device

Parameters
model String: This value may be null.

Returns
Device.Builder This value cannot be null.

setUdi

Added in API level 34
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 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 ERROR(/HealthPermissions#WRITE_DEVICE_UDI) in manifest to be able to set UDI for any record. SecurityException is thrown when upserting a record with UDI without the permission.

Parameters
udi String: This value may be null.

Returns
Device.Builder This value cannot be null.