0

I want to get CPU usage programmatically with Kotlin in an Android application. I tried using the HardwarePropertiesManager class but it seems like it can only be used in devices that are in enterprise mode, is there any alternative?

1 Answer 1

1

If you look at this repo (https://github.com/AntonioRedondo/AnotherMonitor#retrieving-processes-info-since-android-oreo-80-api-26-august-2017), it is not possible since Android 8.0 (API 26). Seems like you can get only memory usage. However, if you still want for old versions, you can look at that repo to know how to get CPU usage, and convert Java code to Koltin (which is easy).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.