part-cw / LNhealth

Health-related apps using the LambdaNative framework
http://lnhealth.lambdanative.org
Other
22 stars 3 forks source link

ShareVitalSigns: Send out more specific intent #3

Closed shaybeau731 closed 6 years ago

shaybeau731 commented 6 years ago

Currently, if an app sends an intent request for any vital sign, and both the PhoneOx and RRate apps are installed on the device, a prompt will appear asking if the user would like to open PhoneOx or RRate. If the selected app does not offer that vital (e.g., intent request was for Heart Rate but RRate was opened), it will launch and then immediately return back to the requesting app, with an error message appearing at the bottom of the screen.

Ideally we would only want to include apps offering that specific vital sign to be included as an option. E.g., the RRate app should only launch if an intent was sent out for Resipratory Rate (and not for Heart Rate, etc).

karliwalti commented 6 years ago

try to restrict the android manifest to a vital sign e.g. move from the generic <action android:name="org.ecemgroup.sharevitalsigns.MEASURE" /> to <action android:name="org.ecemgroup.sharevitalsigns.MEASURE.RR" />

mgorges commented 6 years ago

Thanks @karliwalti - is this for the provider, aka apps/RRate/ANDROID_intent_filters#L2, correct?

karliwalti commented 6 years ago

correct

shaybeau731 commented 6 years ago

I updated apps/RRate/ANDROID_intent_filters to use MEASURE.RR instead of MEASURE. Now when I send a request, RRate isn't launched at all. When I look through the sharevitalsigns Android code, it looks like that feature might not be fully implemented yet? Or is there something that needs to be updated/added to the requesting app?

mgorges commented 6 years ago

@shaybeau731 I believe the pieces is in sharevitalsigns/library/ShareVitalSigns.java#L140

shaybeau731 commented 6 years ago

I've updated sharevitalsigns/library/ShareVitalSigns.java so that it now sends out a more specific intent request. I tested it using the Demo Receiver/Sender apps, PhoneOx, and RRate, and it works as expected. So now we just need to update libraries/sharevitalsigns/sharevitalsigns.jar.

shaybeau731 commented 6 years ago

Fixed in commit 028b17ccf363186f91296cf49d3862d7507bd610