Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect current running application in Android Nougat 7.+ version

Android team changed their approaches to get current running applications from time to time. I am able to get current running applications upto Marshmallow 6.0 version but i want to ask that how can i get these in Nougat 7.0 version? Is there anyway to do that? Please guide towards solutions. I have searched a lot but could find any appropriate way to that.

Thanks

like image 213
Usman Rana Avatar asked Jan 20 '17 16:01

Usman Rana


1 Answers

Simple answer: no, you can't.

Long answer: you can't get the running process but you can retrospectively see what was running through the UsageStatsManager (with the appropriate permissions, of course). The reason you can't get the running process is that Android have locked down the permissions of /proc

like image 141
Ryan Avatar answered Oct 21 '22 21:10

Ryan