Thursday, 2 March 2023

After Android 11, how to obtain cpu usage within android application?

Target

  • I want to monitor the CPU usage for my APP (global CPU usage is also okay for me) within android application.

Background

  • After Android 11, the normal application cannot access to /proc/stat, and
  • HardwarePropertiesManager cannot be used in normal application for the permission "android.permission.DEVICE_POWER" is only granted to system apps.
  • All the solutions that I can obtain in google are the same with the above two methods.

Question

  • So is there any way that I can obtain CPU usage within an android application after Android 11?


from After Android 11, how to obtain cpu usage within android application?

No comments:

Post a Comment