Android examples for App:Package
get Name From Package Name
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; public class Main { public static String getNameFromPackageName(String packageName, Context context) {/* w ww . ja va 2s. c o m*/ PackageManager packageManager = context.getPackageManager(); ApplicationInfo applicationInfo = null; try { applicationInfo = packageManager.getApplicationInfo( packageName, 0); } catch (final PackageManager.NameNotFoundException e) { } if (applicationInfo != null) { return packageManager.getApplicationLabel(applicationInfo) .toString(); } else { return packageName; } } }