health-samples
health-samples copied to clipboard
Measure Data does not work in the latest version of the wear os emulator.
in HealthServicesManager.kt
val callback = object: MeasureCallback { override fun onAvailabilityChanged(dataType: DataType, availability: Availability) { sendBlocking(MeasureMessage.MeasureAvailabilty(availability)) }
override fun onData(data: List<DataPoint>) {
sendBlocking(MeasureMessage.MeasureData(data))
}
}
onAvailabilityChanged is called twice. (availability : ACQUIRING, UNAVAILABLE) onData is not called.
We've recently updated the samples for the alpha02
release - there have been quite a few changes to the Health Services APIs since the Alpha01 release.
We've also updated the guide on using `MeasureClient' here.
Are you able to confirm whether you are still seeing the issue, including with the MeasureData sample?
Going to close this one out for now - if the issue remains with alpha02
, can reopen.
hi @garanj ,
Using Android Studio Arctic Fox | 2020.3.1 Patch 3 with the wear os emulator with R global image to run samples, always shows State UNAVAILABLE.
Is there any extra thing I need to do?
btw, I have tested on alpha02 and alpha03 version. same result
Thanks Julius for this.
Trying with the emulator just now, I get valid HR data when [enabling synthetic data][https://github.com/android/health-samples/tree/main/MeasureData#try-it-with-synthetic-data]
adb shell am broadcast \
-a "whs.USE_SYNTHETIC_PROVIDERS" \
com.google.android.wearable.healthservices
However, as you point out, I'm also not getting any availability updates from Health Services apart from the D/Measuring Data Sample: Availability changed: UNAVAILABLE
message.
I'll need to investigate a bit as to why no messages are coming through regarding availability.
I tired that and it works now. I can see HBM data now. but when I editing the Heart rate sensor value in simulator's visual sensor, I can't receive the data I set. Can you help me for that too? and where the data I get from now?
Hi Julius,
Apologies, for now the emulator virtual sensor configuration isn't hooked up to Health Services, though we can see that this would be a really useful feature, so will be looking at the feasibility.
To configure, take a look at the synthetic data guide
We've filed a bug for the availability message issue.
ok, got it. thanks @garanj
Hello @garanj,
I am trying to visualize the synthetic data on the WearOS example apps you have developed but when I run the adb commands it doesn't show me anything at all.
Running the ExerciseSample app for example, I can see the UI and authorize all the data necessary untill I can start an activity. As soon as I type the adb:
adb shell am broadcast \ -a "whs.USE_SYNTHETIC_PROVIDERS" \ com.google.android.wearable.healthservices
I get the message on terminal:
"Broadcasting: Intent { act=whs.USE_SYNTHETIC_PROVIDERS flg=0x400000 pkg=com.google.android.wearable.healthservices }
Broadcast completed: result=0"
When I run the command to start sending synthetic running data:
adb shell am broadcast \ -a "whs.synthetic.user.START_RUNNING" \ com.google.android.wearable.healthservices
I get the same messages and no feedback on the watch emulator.
Do I need to configure anything in the emulator to receive this synthetic data?
@Zhuxf1111 @garanj @choe-apposter @ithinkihaveacat Is anyone actively solving these issues?
@jtragtenberg In order for synthetic providers to work on the emulator, you need to enable developer options on the device.
We are in the process of updating the developer documentation to explain this.
Have you enabled developer options on the emulator?
@jtragtenberg Documentation has been updated here : https://developer.android.com/training/wearables/health-services/synthetic-data
Which should better cover how to work with synthetic data. Does this help?
Closing this issue; please create a new issue if the problem persists.