DataTypeCreateRequest

public class DataTypeCreateRequest extends AbstractSafeParcelable

A request for inserting an application-specific data type into the Google Fit store. Apps can use this request to define their own custom data types for reading and writing custom data.

The new data type should not duplicate any existing public data type. Apps can obtain the new data type from the result of this request, and use it to insert/read data. Data written in this data type will only be visible to the app that created this data type.

The new data type name should have the app's package name as the prefix. For instance, if the app's package name is "com.exampleapp", then a new data type named "com.exampleapp .custom_data" is permitted. However, a new data type named "com.anotherapp.custom_data" is not permitted.

Sample usage:

     DataTypeCreateRequest request = new DataTypeCreateRequest.Builder()
          .setName("com.app.custom_data")
          .addField("field1", Field.FORMAT_INT32)
          .addField(DataTypes.Fields.ACTIVITY)
          .build();
 

Nested Class Summary

class DataTypeCreateRequest.Builder Builder used to create new DataTypeInsertRequests. 

Inherited Constant Summary

Field Summary

public static final Creator<DataTypeCreateRequest> CREATOR

Public Method Summary

boolean
List<Field>
getFields()
Returns the specified fields for the created data type.
String
getName()
Returns the specified name for the crated data type.
int
String
void
writeToParcel(Parcel dest, int flags)

Inherited Method Summary

Fields

public static final Creator<DataTypeCreateRequest> CREATOR

Public Methods

public boolean equals (Object o)

public List<Field> getFields ()

Returns the specified fields for the created data type.

public String getName ()

Returns the specified name for the crated data type.

public int hashCode ()

public String toString ()

public void writeToParcel (Parcel dest, int flags)