This is the code that i have at the moment but i still can\'t get a list of all the apps on the phone. Does anyone see what i am doing wrong?
public class G
This code logs name and package name of all the installed applications. You can easily check the log using LogCat (if you are using Eclipse).
Package name - name of the app's package.
Name - text label associated with the application. You can't use just appInfo.name
as it will return null
. Using appInfo.loadLabel(packageManager)
you get the actual app's name like Speech Recorder instead of package name com.android.speechrecorder.
final PackageManager packageManager = getPackageManager();
List installedApplications =
packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo appInfo : installedApplications)
{
Log.d("OUTPUT", "Package name : " + appInfo.packageName);
Log.d("OUTPUT", "Name: " + appInfo.loadLabel(packageManager));
}