how to find all apps on android device using java

Solutions on MaxInterview for how to find all apps on android device using java by the best coders in the world

showing results for - "how to find all apps on android device using java"
Noah
02 Jan 2017
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