Get CPU usage of a device running Android 8 Oreo

Viewed 11787

I'm really confused. I have just noticed that starting from Android 8 all system calls like /proc/stat will be disabled. Ok, but what is work around to get CPU Usage in Android 8? No system calls at all. Is there some API that I'm not familiar with?

I really hope that there is solution which I can't see now.

2 Answers

Precise cpu usage since oreo seems not possible from normal app. But on Android we can guess the cpu usage from cpu frequency.

I did a small lib that permit to do that. Here is the code that hopefully is precise enough: available as a class or as a simple app.

Related