Monitoring app launches on android -


i need create app able check when other apps opened or closed ("on resume" or "on pause") on device. need check time of use of each app.

can without root access in device?

try code

 activitymanager activitymanager = (activitymanager) this.getsystemservice( activity_service );     list<runningappprocessinfo> procinfos = actvitymanager.getrunningappprocesses();     for(int = 0; < procinfos.size(); i++){         if(procinfos.get(i).processname.equals("com.android.browser")) {             toast.maketext(getapplicationcontext(), "browser running", toast.length_long).show();         }     } 

find package name using download package name viewer

https://play.google.com/store/apps/details?id=com.gijoon.pkgnameviewer&hl=en


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -