Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get application usage statistics on android?

What I want is to access the time (in milliseconds) that each application is used.

Thanks

like image 226
jlopes Avatar asked Nov 15 '22 07:11

jlopes


1 Answers

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)

Note: while this remains accurate for the circa-2010 versions of Android about which it was written, restrictions added years later in 4.4 and 5.0 would substantially frustrate achieving this in more recent versions.

like image 75
Chris Stratton Avatar answered Dec 26 '22 05:12

Chris Stratton