Google 适合 API - 个人信息 - 身高和体重的单位是什么以及我如何获得性别和生日
Google fit API - personal info - What is the units for height and weight and how i can get the gender and the birthday
我正在尝试从 Android google fit api 获取个人信息(身高、体重、性别和生日)。
我收到了身高和体重,但我不知道单位是什么,
虽然我设置了磅和英寸,但它总是以米和千克为单位收到吗?
如果我在美国,该值也会以米和千克为单位吗?
如何从个人信息中获取性别和生日?
val dataReadRequest = DataReadRequest.Builder()
.read(DataType.TYPE_HEIGHT)
.read(DataType.TYPE_WEIGHT)
.setLimit(1)
.setTimeRange(1, Calendar.getInstance().timeInMillis, TimeUnit.MILLISECONDS)
.build()
val height = dataReadResponse?.dataSets.dataPoints[0].getValue(Field.FIELD_HEIGHT).asFloat())
这是高度数据类型的所有数据点的日志
dataPoints DataPoint{[1.68]@[1556523728544000000, 1556523728544000000,raw=0,insert=0](d:height:gms:overlay_explicit_input r:height:com.google.android.apps.fitness:user_input)}
高度值为 1.68 - 以米为单位,但我设置为 google 适合 5'6"
发件人:
https://developers.google.com/fit/android/data-types#public_data_types
com.google.height The user's height, in meters. Body height (float—meters)
com.google.weight The user's weight. Body weight (float—kg)
是的,身高和体重值将始终以公制为单位。
我正在尝试从 Android google fit api 获取个人信息(身高、体重、性别和生日)。 我收到了身高和体重,但我不知道单位是什么,
虽然我设置了磅和英寸,但它总是以米和千克为单位收到吗?
如果我在美国,该值也会以米和千克为单位吗?
如何从个人信息中获取性别和生日?
val dataReadRequest = DataReadRequest.Builder()
.read(DataType.TYPE_HEIGHT)
.read(DataType.TYPE_WEIGHT)
.setLimit(1)
.setTimeRange(1, Calendar.getInstance().timeInMillis, TimeUnit.MILLISECONDS)
.build()
val height = dataReadResponse?.dataSets.dataPoints[0].getValue(Field.FIELD_HEIGHT).asFloat())
这是高度数据类型的所有数据点的日志
dataPoints DataPoint{[1.68]@[1556523728544000000, 1556523728544000000,raw=0,insert=0](d:height:gms:overlay_explicit_input r:height:com.google.android.apps.fitness:user_input)}
高度值为 1.68 - 以米为单位,但我设置为 google 适合 5'6"
发件人:
https://developers.google.com/fit/android/data-types#public_data_types
com.google.height The user's height, in meters. Body height (float—meters)
com.google.weight The user's weight. Body weight (float—kg)
是的,身高和体重值将始终以公制为单位。