[android-developers] Re: cpu usage information

2012-03-13 Thread oneking
Thank you. have you an example code?

I am new to android programation

On Mar 13, 11:57 am, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 12 March 2012 18:11, oneking onekingg...@gmail.com wrote:

  How to make a pie chart that tells me cpu usage or memory ram?

  This is a example:

 http://gadgetsdna.com/wp-content/uploads/2010/03/SystemPanel-fo-Andro...

 The same way as you would make pie chart of any other data. you need: a)
 data to visualise (be it cpu usage or anything else) b) pie chart drawing
 routine (your own or 3rd party). Once you got that, combine them together
 and voila. You got what you needed.

 Regards,
 Marcin Orlowski

 *Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy...
 *Date In Tray* http://bit.ly/dateintraypro - current date at glance...
 WebnetMobile on *Facebook http://webnetmobile.com/fb/*,
 *Google+*http://bit.ly/webnetmobile-gpand
 *Twitter http://webnetmobile.com/twitter/*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: CPU usage stats

2010-10-06 Thread askPrins
As a developer I would say it is VERY important to measure how
efficient your implementation (code) is.
CPU usage (which can sucks the battery) and memory usage etc are very
important issues specially for developers.




On Sep 8, 8:18 pm, Frank Weiss fewe...@gmail.com wrote:
 On Wed, Sep 8, 2010 at 3:01 AM, Andy a...@fendley.com wrote:
  Hi all,

  Thanks for the input and I think these comments answer my question.
  Maybe it would be an idea to allow an SDK api to access these stats as
  they, in my view for applications, can be very useful due to the heavy
  multitasking nature of android?

  I suppose the question is for whom would this be useful? How many

 developers are going to need to do this with the SDK?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: CPU usage stats

2010-10-06 Thread Moto
I know it's not the same using an actual phone than an emulator, but
on the emulator there is an option I believe that shows CPU status...

-Moto

On Oct 6, 9:58 am, askPrins askpr...@gmail.com wrote:
 As a developer I would say it is VERY important to measure how
 efficient your implementation (code) is.
 CPU usage (which can sucks the battery) and memory usage etc are very
 important issues specially for developers.

 On Sep 8, 8:18 pm, Frank Weiss fewe...@gmail.com wrote:

  On Wed, Sep 8, 2010 at 3:01 AM, Andy a...@fendley.com wrote:
   Hi all,

   Thanks for the input and I think these comments answer my question.
   Maybe it would be an idea to allow an SDK api to access these stats as
   they, in my view for applications, can be very useful due to the heavy
   multitasking nature of android?

   I suppose the question is for whom would this be useful? How many

  developers are going to need to do this with the SDK?



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: CPU usage stats

2010-10-06 Thread Dianne Hackborn
On Wed, Oct 6, 2010 at 6:58 AM, askPrins askpr...@gmail.com wrote:

 As a developer I would say it is VERY important to measure how
 efficient your implementation (code) is.
 CPU usage (which can sucks the battery) and memory usage etc are very
 important issues specially for developers.


For profiling your app, use this:
http://developer.android.com/reference/android/os/Debug.html#threadCpuTimeNanos()

Or better yet, run the profiler on your code.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: CPU usage stats

2010-09-08 Thread Andy
Hi all,

Thanks for the input and I think these comments answer my question.
Maybe it would be an idea to allow an SDK api to access these stats as
they, in my view for applications, can be very useful due to the heavy
multitasking nature of android?

Regards,

Andy

On Sep 7, 12:30 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Sep 7, 2010 at 4:25 AM, CHENG LUO stand...@gmail.com wrote:
  Maybe you could have a look at com.android.server.ProcessStats :)

 That is not part of the Android SDK.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training in London:http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: CPU usage stats

2010-09-08 Thread Frank Weiss
On Wed, Sep 8, 2010 at 3:01 AM, Andy a...@fendley.com wrote:

 Hi all,

 Thanks for the input and I think these comments answer my question.
 Maybe it would be an idea to allow an SDK api to access these stats as
 they, in my view for applications, can be very useful due to the heavy
 multitasking nature of android?

 I suppose the question is for whom would this be useful? How many
developers are going to need to do this with the SDK?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: CPU usage stats

2010-09-07 Thread CHENG LUO
Hi,

Maybe you could have a look at com.android.server.ProcessStats :)

Cheng

On 6 sep, 17:33, Andy a...@fendley.com wrote:
 Hi everyone,

 Does anyone know of a direct api that allows access to CPU usage
 statistics for different applications/tasks running inside android?
 All I can find is data available by accessing a file /proc/stat  but
 this seems a little cumbersome. ActivityManager holds data about
 processes/tasks etc but no CPU usage stats.

 Many thanks for any help.

 Andy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: CPU usage stats

2010-09-07 Thread Mark Murphy
On Tue, Sep 7, 2010 at 4:25 AM, CHENG LUO stand...@gmail.com wrote:
 Maybe you could have a look at com.android.server.ProcessStats :)

That is not part of the Android SDK.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: CPU usage stats

2010-09-06 Thread Maps.Huge.Info (Maps API Guru)
If you want to do it from the shell, just use top.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: CPU usage stats

2010-09-06 Thread Andy
Thats great thanks but I want to access these stats from inside a
running Activity...just wondered if there was a direct api to use.

Regards,

Andy



On Sep 6, 5:02 pm, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
wrote:
 If you want to do it from the shell, just use top.

 -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: CPU usage stats

2010-09-06 Thread Frank Weiss
Not in the SDK. I suppose because most uses of this is by developers
who can simply use adb or ddms.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: CPU usage stats

2010-09-06 Thread Dianne Hackborn
There isn't an SDK API for this.  Also note that /proc is not part of the
SDK -- you can't count on the contents of /proc remaining compatible in
future versions.

On Mon, Sep 6, 2010 at 9:45 AM, Andy a...@fendley.com wrote:

 Thats great thanks but I want to access these stats from inside a
 running Activity...just wondered if there was a direct api to use.

 Regards,

 Andy



 On Sep 6, 5:02 pm, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
 wrote:
  If you want to do it from the shell, just use top.
 
  -John Coryat

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: CPU usage power management question

2010-04-06 Thread Lauri Ehrenpreis
investigated this myself littlebit:

Indeed the top only knows about currently configured cpu
frequency so if power management has set it to 245Mhz on nexusone
then com.android.wallpaper app can easily show 20..30% cpu
usage but at 499mhz the cpu usage is ~12%...

Found a nice solution to this: to get cpu usage % that is not affected
by power management decisions one can install setCPU app
(http://forum.xda-developers.com/showthread.php?t=505419)
This allows you to modify min  max possible cpu frequency.
When setting min freq == max freq I can compare cpu
usage % between different experiments without having to worry
about what frequency power management decides to use during
experiment.

Br,
Lauri

On Apr 1, 4:54 pm, Lauri Ehrenpreis lauri...@gmail.com wrote:
 Hi!

 The easiest way to get some idea about cpu usage on android seems to
 be the top utility (adb shell top)
 However it seems to me that due to power management the cpu frequency
 is changing all the time (i can see this when doing cat /proc/cpuinfo
 - the BogoMIPS value is changing drastically). So the question is that
 how does top calculate the cpu usage percent? Is it aware of max
 possible cpu frequency and calculates based on that or it calculates
 based on current cpu frequency?

 Consider these 2 cases:
 1) BogoMIPS shows 100 while top says my process takes 50% of the cpu
 2) BocoMIPS shows 600 while top says my process takes 50% of the cpu
 Does this mean that in first case my process was eating 50 BogoMIPS
 and in second case 300 (top is not aware of max possible cpu freq)? or
 in both cases my process took same amount of cpu (top is aware of max
 freq)?

 Br,
 Lauri

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: CPU usage detect

2009-09-30 Thread fulanito

open a terminal on the device with 'adb shell',
and then use the standart linux 'top' command.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: CPU usage api's query

2009-07-15 Thread Dianne Hackborn
There is no such concept as a high priority application running which might
need the entire CPU, sorry.

On Wed, Jul 15, 2009 at 6:06 AM, sukumar bhashyam 
bhashyam.suku...@gmail.com wrote:

 Hello,
 I'm trying to develop a service, which needs to be run in background as a
  low priority task and does some complex processing . I need to gracefully
 quit my service when their is a resource shortage( like CPU running low on
 memory). Was there any APIs available to know the CPU resource usage ?.
 Objectives of my service is to -
1. Exit service when a high priority application(s) is running and which
  might need entire CPU resources.
   2. Should store my states before onDestroy() of my service is called.

 I'm planning to use CPU resource usage api's in service to
 check periodically the CPU load and quit the service if CPU load exceed a
 threshold(80 %) after storing states. Please let me know of any better way
 of handling the objectives of my service stated above. Thanks.

 Regards,
 Sukumar.

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: CPU usage api's query

2009-07-15 Thread dadical

Is there any way to monitor CPU usage of a java thread from android?
It doesn't seem that android supports the ThreadMXBean or the
ManagementFactory.  What is available?  I noticed that Process offers
some very limited information, but I don't think that I can narrow
that down to actual thread usage -- it's just reporting process-level
information.





On Jul 15, 1:10 pm, Dianne Hackborn hack...@android.com wrote:
 There is no such concept as a high priority application running which might
 need the entire CPU, sorry.

 On Wed, Jul 15, 2009 at 6:06 AM, sukumar bhashyam 





 bhashyam.suku...@gmail.com wrote:
  Hello,
  I'm trying to develop a service, which needs to be run in background as a
   low priority task and does some complex processing . I need to gracefully
  quit my service when their is a resource shortage( like CPU running low on
  memory). Was there any APIs available to know the CPU resource usage ?.
  Objectives of my service is to -
     1. Exit service when a high priority application(s) is running and which
   might need entire CPU resources.
    2. Should store my states before onDestroy() of my service is called.

  I'm planning to use CPU resource usage api's in service to
  check periodically the CPU load and quit the service if CPU load exceed a
  threshold(80 %) after storing states. Please let me know of any better way
  of handling the objectives of my service stated above. Thanks.

  Regards,
  Sukumar.

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ::CPU usage

2008-12-08 Thread fcalzada

Hi,

Do you have any real benchmark to provide (based on real phone) ?
Like it is done on the jbenchmark site? (Although it's only for java
code)



On Dec 7, 3:06 am, Dianne Hackborn [EMAIL PROTECTED] wrote:
 You really can't judge performance based on the emulator.  Ignoring the CPU
 emulation, there is no emulation of the memory bus, it doesn't do any
 graphics hardware acceleration, etc.

 Ultimately you need to do development on a real device, that is the only way
 to know how your application is actually going to behave.

 On Sat, Dec 6, 2008 at 6:12 AM, Xavier Mathews [EMAIL PROTECTED]wrote:





  Yes it will depending on the processor speed of the device. 50% Is Alot.

  On 12/06/2008, Mark Murphy [EMAIL PROTECTED] wrote:

   Imran wrote:
   Hi All...!!!

          i have developed a small  game application... i have a
   problem... when i run the application  it is using 50% of CPU (mine is
   2Ghz processor )... will this create a problem in actual device..

   Possibly.

   The emulator is inefficient, in that it has to convert ARM instructions
   into x86 instructions for execution on your development PC. This adds a
   fair bit of overhead, which results in a higher-than-expected CPU
   utilization.

   However, it is very difficult to project how a certain CPU utilization
   on the development PC will translate into CPU utilization on a device.

   --
   Mark Murphy (a Commons Guy)
  http://commonsware.com
   _The Busy Coder's Guide to Android Development_ Version 1.9 Available!

  --
  Xavier A. Mathews
  Student/Browser Specialist/Developer/Web-Master
  Google Group Client Based Tech Support Specialist
  Hazel Crest Illinois
  [EMAIL PROTECTED]@[EMAIL PROTECTED]
  Fear of a name, only increases fear of the thing itself.

 --
 Dianne Hackborn
 Android framework engineer
 [EMAIL PROTECTED]

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ::CPU usage

2008-12-06 Thread Mark Murphy

Imran wrote:
 Hi All...!!!
 
i have developed a small  game application... i have a
 problem... when i run the application  it is using 50% of CPU (mine is
 2Ghz processor )... will this create a problem in actual device.. 

Possibly.

The emulator is inefficient, in that it has to convert ARM instructions 
into x86 instructions for execution on your development PC. This adds a 
fair bit of overhead, which results in a higher-than-expected CPU 
utilization.

However, it is very difficult to project how a certain CPU utilization 
on the development PC will translate into CPU utilization on a device.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ::CPU usage

2008-12-06 Thread Xavier Mathews

Yes it will depending on the processor speed of the device. 50% Is Alot.

On 12/06/2008, Mark Murphy [EMAIL PROTECTED] wrote:

 Imran wrote:
 Hi All...!!!

i have developed a small  game application... i have a
 problem... when i run the application  it is using 50% of CPU (mine is
 2Ghz processor )... will this create a problem in actual device..

 Possibly.

 The emulator is inefficient, in that it has to convert ARM instructions
 into x86 instructions for execution on your development PC. This adds a
 fair bit of overhead, which results in a higher-than-expected CPU
 utilization.

 However, it is very difficult to project how a certain CPU utilization
 on the development PC will translate into CPU utilization on a device.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.9 Available!

 



-- 
Xavier A. Mathews
Student/Browser Specialist/Developer/Web-Master
Google Group Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]@[EMAIL PROTECTED]
Fear of a name, only increases fear of the thing itself.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ::CPU usage

2008-12-06 Thread Dianne Hackborn
You really can't judge performance based on the emulator.  Ignoring the CPU
emulation, there is no emulation of the memory bus, it doesn't do any
graphics hardware acceleration, etc.

Ultimately you need to do development on a real device, that is the only way
to know how your application is actually going to behave.

On Sat, Dec 6, 2008 at 6:12 AM, Xavier Mathews [EMAIL PROTECTED]wrote:


 Yes it will depending on the processor speed of the device. 50% Is Alot.

 On 12/06/2008, Mark Murphy [EMAIL PROTECTED] wrote:
 
  Imran wrote:
  Hi All...!!!
 
 i have developed a small  game application... i have a
  problem... when i run the application  it is using 50% of CPU (mine is
  2Ghz processor )... will this create a problem in actual device..
 
  Possibly.
 
  The emulator is inefficient, in that it has to convert ARM instructions
  into x86 instructions for execution on your development PC. This adds a
  fair bit of overhead, which results in a higher-than-expected CPU
  utilization.
 
  However, it is very difficult to project how a certain CPU utilization
  on the development PC will translate into CPU utilization on a device.
 
  --
  Mark Murphy (a Commons Guy)
  http://commonsware.com
  _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
 
  
 


 --
 Xavier A. Mathews
 Student/Browser Specialist/Developer/Web-Master
 Google Group Client Based Tech Support Specialist
 Hazel Crest Illinois
 [EMAIL PROTECTED]@[EMAIL PROTECTED]
 Fear of a name, only increases fear of the thing itself.

 



-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---