views:

61

answers:

3

How to get application usage statistics on android? What I want is to access the time (in milliseconds) that each aplication is used.

Thanks

A: 

You could use TraceView. Did you mean by programming?

By Programming, You can check out how SpareParts does it.

st0le
Yes, by programming...
@user, Updated answer. Posted a link...
st0le
A: 

I need to create an android application to store on a database the usage time per application. On emulator, there is an application called Spare parts that has an usage statistics menu. I need to get something like that.

Any ideas?

Thanks

A: 

Dig up the source to "Spare Parts" and see how they do it

(also copy it off the emulator, install it on your phone and make sure it works)

Chris Stratton
The "Spare Parts" source code has some classes from private API. And i'm not able to view how it's done...
At this moment I am able to get an event every time any application is opened by user, and i could store a timestamp, then i need to find a way to get an event to when application goes to background. And now i have this problem.
The private api's are available in source form on android.git.kernel.org however you may or may not be able to reproduce that functionality in a way consistent with the android architects' vision of what a well behaved application can or should do.
Chris Stratton