FSchiltz/Helse

Add support for reading google health

Opened this issue · 13 comments

Add support for reading google health

It will be awesome!

i've seen some flutter lib to do it but I don't have a compatible phone to test unfortunately.

I think that there are Android emulators where you can work on, take a look at the following pages:
https://developer.android.com/codelabs/health-connect#5
https://developer.android.com/studio

It look like it needs a phone still but I have an old android phone that I could setup as a test platform.

I just release the version 0.5 of the native application on android in the release page that support health connect.
It's not possible to support google fit because it's deprecated and the dev acces for new app was closed last month.

This version was only tested on android 14 and you need the beta Health connect installed if on a lower version.

It will only sync in when the app is in the foreground and will display a heart with the status (no detail of the execution for now).
It may crash still and only import Heart, steps, weight and blood oxygen and only the last 30 days of data..

I installed the 0.7 version, allowed Health connect for all metrics, but nothing is being displayed yet on the app, even the heart is green.
Additionally, It will be great if the date sector have pre-built range like: week, month, 3 months, 6 months, 1 year, Year to date and it's permanent thru Settings.

You may need to change the range to see the data, the widget are not updated yet when new data are added to the app.
I need to add the refresh in a future update.

Also I need to add a better way to see the status of the importation

Nothing even changing date range and closing / reopening the app.
Checking at Health Connect app, Helse has read permissions, but at the Recent Access field there is no Helse log.

I'll add a popup with the result of the sync then. Do you have steps or heart rate data in the last 30 days ?
I used the toolbox to test: https://developer.android.com/health-and-fitness/guides/health-connect/test/health-connect-toolbox
You can use that to see what data your phone can support.

I made a popup when clicking on the heart to see the status and a button in the settings to reset the last run date so the sync will run again. (after a successful run, the app will only ask for new metric to the health connect sdk)

You can find that prerelease version here in the artifacts.zip: https://github.com/FSchiltz/Helse/actions/runs/9037728894

It won't work, I found a bug on my phone.
Next step would be to add unit tests on the Ui part.

It's working in version 0.10 but it can only get 30 days of data and I only import 4 metrics.