How to list and monitor the app's that are installed and / or in use?

6

On an Android device, where they are running many app's, would allow an interface where the user can see what's app installed and which are running at the moment, and you can start, pause and uninstall an app.

  • Where do I start?
  • What classes, methods or interfaces responsible for the app's list in order to monitor them?
  • asked by anonymous 27.10.2014 / 17:13

    2 answers

    3
  • As the response in SO-en the method should be called this way (% with% is only available in API level 14 ):

    Uri packageUri = Uri.parse("package:org.PACOTE");
    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);
    startActivity(uninstallIntent);
    
  • (Up to API Level 20) To list applications that are running (or recently running) as is SO- en the code should look something like:

    final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    final List<RunningTaskInfo> recentTasks = activityManager.getRunningTasks(Integer.MAX_VALUE);
    
    for (int i = 0; i < recentTasks.size(); i++)  {
        Log.d("Aplicativo executado", "Aplicativo: " + recentTasks.get(i).baseActivity.toShortString() + "\t\t ID: " + recentTasks.get(i).id);
    }
    
  • For API Level 21 use ACTION_UNINSTALL_PACKAGE

  • 24.12.2014 / 22:05
    -1

    It is part of the Android System, referring to Java Lang: see this link that talks about the methods, interfaces ...: link . Click here to see an example.

        
    20.11.2014 / 20:13