-
Notifications
You must be signed in to change notification settings - Fork 113
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
Does Google Fit SDK work on WearOS? #70
Comments
Hi @ZhEgor have you been able to achieve a communication between phone app and watch to read heart rate data? |
@Deepika1498 Yes, I was able to get the heart rate data from Google fit on a watch in the end, but I don't know what fixed it. Maybe I verified the google console account or I added google-service.json from firebase to the project, or I added DataReadRequest.BuilderenableServerQueries(). |
Do you happen to have the code to that project? It'll be very useful if you could pls share . I am doing this as a part of college project. I've been trying to achieve this for the past two months, haven't been able to. I'd really appreciate if you could please help. |
GoogleFitPermissionsManager.kt
GoogleFitRepository.kt
AndroidManifest.xml
|
you can also use HealthServices to collect heart rate or steps. |
Are these the complete set of files required for the project? |
For the setting up Google Fit - yes, if we don't mention dependency for Google Fit. |
Do you have a repo or something which has entire code that's necessary? |
That's full code, I extracted this code from a module, which is fully dedicated to Google Fit, the module contains only two files. Alas I am not allowed to share the repo. |
Hi
On Wed, 19 Apr 2023 at 16:06 Deepika1498 ***@***.***> wrote:
Hi @ZhEgor <https://github.com/ZhEgor> have you been able to achieve a
communication between phone app and watch to read heart rate data?
—
Reply to this email directly, view it on GitHub
<#70 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWZELFYYPYKCF5WBOJBJ5UDXB6THXANCNFSM6AAAAAASZLGN6Y>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Mr Trung Pham ,Architect
Work : +84 985 515 288
+1 317-344 9869 (sms)
Private : +84 909 044 888
Home : +84-28-3 636 8848
https://linktr.ee/trungphamfile
Please let text message, i will call back soon!
|
This is the code I have written to get heart rate data from the sensor on watch:
} |
@Deepika1498 it seems you unregister the listener before it even manages to collect any data. And right after this function
|
thank you very much @ZhEgor it works now |
Hi guys, I have two apps one for wearable and one for handheld device and we have mutual source of fit data - Google Fit. So when I request data on watches, I catch this exception on
57th line
:17: API: Fitness.CLIENT is not available on this device. Connection failed with: ConnectionResult{statusCode=INVALID_ACCOUNT, resolution=null, message=null}
Devices: Fossil Gen 6 (real device API 30, API 28), WearOS Small Round (Android Studio Emulator API 30)
I tried to run the same code on a phone app and I didin't receive an error. So I wonder, maybe didn't Google Fit API suppose to work on watches at all? If so, what workarounds can I use? Should I use Google Fit REST API?
Maybe someone has already encountered this problem, it would be useful to hear how they managed to deal with this.
Thanks in advance!
The text was updated successfully, but these errors were encountered: