0

Search but could not find proper answer I want to monitor CPU usage if it drops to 10% I would like to show toast message.

Anyone have done or read somewhere please refer to me.

Thanks

Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
Fou
  • 896
  • 2
  • 8
  • 19

1 Answers1

0

You can use Systrace to monitor whatever you want.

Using Eclipse:

  • In Eclipse, open an Android application project.
  • Switch to the DDMS perspective, by selecting Window > Perspectives > DDMS.
  • In the Devices tab, select the device on which to run a trace. If no devices are listed, make sure your device is connected via USB cable and that debugging is enabled on the device.
  • Click the Systrace icon enter image description here at the top of the Devices panel to configure tracing.
  • Set the tracing options and click OK to start the trace.

Using Android Studio

  • In Android Studio, open an Android application project.
  • Open the Device Monitor by selecting Tools > Android > Android Device Monitor.
  • In the Devices tab, select the device on which to run a trace. If no devices are listed, make sure your device is connected via USB cable and that debugging is enabled on the device.
  • Click the Systrace icon enter image description here at the top of the Devices panel to configure tracing.
  • Set the tracing options and click OK to start the trace.

Using Device Monitor

  • Navigate to your SDK tools/ directory.
  • Run the monitor program.
  • In the Devices tab, select the device on which to run a trace. If no devices are listed, make sure your device is connected via USB cable and that debugging is enabled on the device.
  • Click the Systrace icon enter image description here at the top of the Devices panel to configure tracing.
  • Set the tracing options and click OK to start the trace.

For more information take a look this website: http://developer.android.com/tools/help/systrace.html

Lennon Spirlandelli
  • 3,131
  • 5
  • 26
  • 51
  • so you are talking about monitoring i am after check on run-time..not in debug mode – Fou May 26 '15 at 14:47
  • You asked about how to monitor in real time and that solution you might monitor in real time. You don't need to debug your app at all. You just need to run your project and do it. However if you wanna to get info in code, take a look this first answer http://stackoverflow.com/questions/2467579/how-to-get-cpu-usage-statistics-on-android – Lennon Spirlandelli May 26 '15 at 15:00