1final PackageManager pm = getPackageManager();
2//get a list of installed apps.
3List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
4
5for (ApplicationInfo packageInfo : packages) {
6 Log.d(TAG, "Installed package :" + packageInfo.packageName);
7 Log.d(TAG, "Source dir : " + packageInfo.sourceDir);
8 Log.d(TAG, "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
9}
10// the getLaunchIntentForPackage returns an intent that you can use with startActivity()
11