[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