• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Detecting App Launch without ActivityManager or UsageStats

  • Thread starter Thread starter Member 1973962
  • Start date Start date
M

Member 1973962

Guest
Hello everybody,

currently I am developing a research app which is examining media usage behavior. At the moment I'm trying to add a new feature where the usage of a given list of apps is tracked.

Here is where I am having some issues. In order to do that, i need to know which app is currently running in the foreground or if an App from the list is launched. In older APIs I can simply use ActivityManager + getSystemService(), but unfortunately it doesn't work in API21+ anymore due to security concerns.
Instead, they have implemented UsageStats, which should do the trick as well, but a few manufactures (e.g. LG and some others) seem to have completely deactivated that function.

Does anybody has any idea how to get that tracking feature in another way? You'd help me a lot!
Thanks
 
Back
Top Bottom