I have been trying to create a data field that calculates the DFA Alpha 1 variable based on beat-to-beat intervals. And I have achieved this by using the ANT+ lib by looking at the other posts on the forum. However, this requires that the user disconnects their heart rate monitor, which is not desirable. That is why I want to access the data using the Sensor lib. But again, I have problems using the API in a data field. And I have seen that this is only possible to do in a background process on an edge device? But again I have tried, but I still get either "Encountered an app crash." or that I am not allowed to access the API in a data field.
The app is implemented as a widget for now, but it would be better if the data were shown in a data field. So any ideas if it is possible?