jlopes
jlopes

Reputation: 1022

How to get application usage statistics on android?

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

Thanks

Upvotes: 5

Views: 3609

Answers (5)

Ayodele Kayode
Ayodele Kayode

Reputation: 314

you can try to use FireBase Analytics.

Upvotes: 0

Appafly
Appafly

Reputation: 666

Firebase Analytics has a cool feature where it tracks the average time on each screen and the percentage of which screen is used most often.

Is this is good enough for you, I would suggest adding Firebase to your app, as it has a free plan, and it will automatically track your users' time. You can start here

Hope this helps

Upvotes: 0

TejaDroid
TejaDroid

Reputation: 6821

@João Lopes,Chris Stratton

Google Provide the sample code for AppUsageStatistics Sample

Here full of statistics base on daily weekly monthly usages.

Upvotes: 0

Chris Stratton
Chris Stratton

Reputation: 40407

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.

Upvotes: 1

st0le
st0le

Reputation: 33575

You could use TraceView. Did you mean by programming?

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

Upvotes: 0

Related Questions