Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HEALTH] Added getTotalCaloriesInInterval and getTotalDistanceInInterval methods #900

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

YatsenkoDev
Copy link

Added new methods, getTotalCaloriesInInterval and getTotalDistanceInInterval, using a similar approach to the existing getTotalStepsInInterval for retrieving the aggregated total distance and calories using native Android and iOS methods. The implementation is based on the existing code from getTotalStepsInInterval.

@rikinpatoliya

This comment was marked as off-topic.

@YatsenkoDev
Copy link
Author

READ_TOTAL_CALORIES_BURNED permission not showing on permission pages.

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!-- Permissions for new android API (Health Connect) -->
    <uses-permission android:name="android.permission.health.READ_STEPS" />
    <uses-permission android:name="android.permission.health.READ_TOTAL_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.WRITE_TOTAL_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.READ_ACTIVE_CALORIES_BURNED" />

WhatsApp Image 2024-03-21 at 12 42 21_b0e440c7

Sorry mate, but I don't think this issue is related to the current pull request.

@SlimShadyIAm
Copy link
Contributor

Hi @YatsenkoDev, thanks for your PR, this looks like a useful addition!

There have been some changes on master, would you mind updating your PR to resolve the merge conflicts?

@SlimShadyIAm SlimShadyIAm added the awaiting feedback Waiting for the user to respond to the latest comment label Jul 30, 2024
@tntkhang
Copy link

Hi @YatsenkoDev, It still had some total value off when I tried to get data per day. I have tried to get a whole month, then I found that in some days the value is not matched.
Let's look at this output:
For Calories:
Logging from the App:
image
And a detailed screenshot from the Health App on the phone:
image
image

As the comparison, we have some differences in some days:
Oct 31: 241/256
Oct 29: 500/498
Oct 28: 638/636
Oct 27 - 601/606 

Like calories, with distance I also tried to get for a month and also found some days value does not match with health detail.
Logging from the app:
image
And a detailed screenshot from the Health App on the phone:
image
image
Some days not matched:
Oct 31: 0.8/0.94
Oct 30: 3.9/3.8

So why does it still have some days not matched? Is there any other solution to make it exactly the same value as displayed in Health?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Waiting for the user to respond to the latest comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants