Android examples for App:Package
get All Apps PackageInfo
//package com.java2s; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import java.util.ArrayList; import java.util.List; public class Main { public static List<PackageInfo> getAllApps(Context context) { List<PackageInfo> apps = new ArrayList<PackageInfo>(); PackageManager pManager = context.getPackageManager(); List<PackageInfo> paklist = pManager.getInstalledPackages(0); if (paklist != null) { for (PackageInfo pak : paklist) { if ((pak.applicationInfo.flags & pak.applicationInfo.FLAG_SYSTEM) <= 0) { // customs applications apps.add(pak);/* w w w .java 2s . c o m*/ } } } return apps; } }