get Installed Packages - Android android.content.pm

Android examples for android.content.pm:PackageManager

Description

get Installed Packages

Demo Code

import java.util.List;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

public class Main {

  public static List<PackageInfo> getInstalledPackages(Context context) {
    PackageManager pkgManager = context.getPackageManager();
    return pkgManager
        .getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);
  }/*from  w ww  .  ja v  a  2  s  . c om*/

}

Related Tutorials