Here you can find the source of getApplicationName(Context context)
public static String getApplicationName(Context context)
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; public class Main { public static String getApplicationName(Context context) { PackageManager packageManager = null; ApplicationInfo applicationInfo = null; try {/* w ww .j a v a 2 s . com*/ packageManager = context.getPackageManager(); applicationInfo = packageManager.getApplicationInfo( context.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { applicationInfo = null; } String applicationName = (String) packageManager .getApplicationLabel(applicationInfo); return applicationName; } }