Android examples for android.os:PowerManager
get App Label
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.os.Build; import android.os.Environment; import java.io.File; import java.lang.reflect.Field; public class Main{ public static String getAppLabel(Context paramContext) { try {/*from w w w . j av a 2 s. c om*/ PackageManager localPackageManager = paramContext .getPackageManager(); paramContext = paramContext.getPackageName(); if ((localPackageManager != null) && (paramContext != null)) { paramContext = localPackageManager .getApplicationLabel( localPackageManager.getPackageInfo( paramContext, 1).applicationInfo) .toString(); return paramContext; } } catch (PackageManager.NameNotFoundException paramContext) { paramContext.printStackTrace(); } return null; } }