Android examples for App:App Information
app Name Lookup
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.util.Log; public class Main { public static String appNameLookup(Context context, String packageName) { try {//from w w w .ja va 2s . c o m PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(packageName, 0); return pm.getApplicationLabel(ai).toString(); } catch (final PackageManager.NameNotFoundException e) { e.printStackTrace(); Log.e("AppsHelper", "Could not resolve name " + packageName); return null; } } }