-5

Possible Duplicate:
How to get a list of installed android applications and pick one to run

We have using a android mobile.

  1. How to list out All Installed Applications.
  2. How to list out All Running Applications.

Help Me. Thanks.

Community
  • 1
  • 1
Sathish Sathish
  • 2,091
  • 3
  • 17
  • 20

1 Answers1

26

To get the list of activities/applications installed on Android:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

Referred from: How to get a list of installed android applications and pick one to run

To check all running applications

ActivityManager actvityManager = (ActivityManager)
this.getSystemService( ACTIVITY_SERVICE );
List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();

Referred From: http://www.dreamincode.net/forums/topic/138412-android-20-list-of-running-applications/

Note: Above described function will return correct result for below API 21, for 21 and above it's deprecated.

Community
  • 1
  • 1
Ponmalar
  • 6,656
  • 10
  • 46
  • 76