It appears possible to access CPU temperature from within code as evidenced by this app called "CPU monitor" [unless it's a fake temperature]. How can I do this? There are similar questions on Stackexchange but they are old and offer no conclusive solution.
A high-level description of how this could be achieved would already be valuable!
Edit: I want this app to be able to be shared widely on the Google Play store, so no root or other special requirements would be ideal.
I did read around and found explanations on stackoverflow - but they may be outdated and are often incomplete and detail oriented rather than general.