0

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.

Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55

1 Answers1

1

Android is mainly based on Linux and in Linux everything is a file. For this reason I think that this solution taken from stackoverflow could be a good initial idea.
There are even more Q&A about CPU temperature on stackoverflow and there are different way to obtain that value.

For example some solutions need that your app is a device owner (administrator) and others need root permissions.

From an high-level description Android usea files to save information about hardware and an app has to read those files in order to obtain informations.

  • The file system trick works, but it varies from device to device. I'm curious how the app developers of the above-mentioned app managed to abstract the problem. I'll try decompiling the app. – Cornelius Roemer Dec 11 '19 at 19:46