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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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