Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

App usage on API <= KitKat

 
Brendon McCullum
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All, I'm trying to find out the time for which an app is used in Android. In Android L, there's a nicely defined API called UsageStats to cater to my needs, but I'm finding it bit difficult to find this information on pre-L devices. I have a workaround for this, but I feel it's not a good approach to deal with this. Is there any way I can get the launch time of any app on device and the exit time too (when it goes away from foreground). Continuously polling ActivityManager can help, but if the launch and exit times can be found, it will be a better way of doing this.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!