HR every 10 seconds, automatic start an activity and communicate with custom mobile app

Hi.

I am evaluating the possibility to create an OpenSource mobile app to count calories (show to user historic of calories graph of last 24h) and I would appreciate your guidance as experienced developers.

I have a Forerunner 245 and I also feel the need to have automatic start of a generic activity recording, because I ride a bicycle a few times a day for going to shop, work and gym and I don´t want / can´t start manually an activity all that times -- I need to have the credit for Training Load as only a recorded activity with HR will count for the Training Load.

My questions:

1. what type on app on watch is possible to develop that will continuous track the HR every 10 seconds and after a threshold of HR >= 90 during 1 minute, start automatically recording an activity. Pause after 1 minutes HR < 90 and save activity when HR < 90 for 5 minutes? -- I wish to have an app running in background and let user use his preferred watch face, etc.

2. I need to communicate with the mobile app, to send HR historic and calculated calories historic. I will also want to receive from the mobile app, the input / eat calories historic. I want to show both on watch and mobile app the historic graph and the balance of calories.

How would you implement such app on the watch?