Skip to content

ActiveCaloriesBurnedRecord returns empty list despite available data in google fit app #328

@BhavinPI

Description

@BhavinPI

I am currently integrating Health Connect into my Android app and trying to read ActiveCaloriesBurnedRecord using the Health Connect client. However, the result is consistently an empty list, even though I have confirmed that there is active calorie data present in the Google Fit.

I have verified:

  • The app has the necessary read permissions for ActiveCaloriesBurnedRecord.
  • Other types of records like StepsRecord or HeartRateRecord return valid data.
  • I have queried with a valid time range that should contain active calories data.

Code Snippet:

val request = ReadRecordsRequest(
    recordType = ActiveCaloriesBurnedRecord::class,
    timeRangeFilter = TimeRangeFilter.between(startTime, endTime)
)
val response = healthConnectClient.readRecords(request)
val records = response.records

Permissions Granted:

setOf(
    Permission.read(ActiveCaloriesBurnedRecord::class),
    // Other permissions like StepsRecord and HeartRateRecord
)

Device & Setup Info:

  • Device: Samsung Note 20, Android 13
  • Health Connect Version: 1.1.0-alpha07
  • Health Data Source: Google Fit, Health Connect Client
  • Kotlin/XML
  • Health Connect Installed via Play Store

What I Expected:
The client should return a list of ActiveCaloriesBurnedRecord within the queried time range if the data exists in Health Connect.

What Actually Happened:
The result is always an empty list even when active calorie data is visible in the source app.

Let me know if you need a sample project or logs. I’m happy to provide more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions