Android APK Information Get getApplicationName(Context context)

Here you can find the source of getApplicationName(Context context)

Description

get Application Name

Declaration

public static String getApplicationName(Context context) 

Method Source Code

//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;
    }
}

Related

  1. getNameApkInstalledFile(String packageName, int type)
  2. isAppPlatformSignature(Context ctx)
  3. isApplicationBroughtToBackground(Context context)
  4. isApplicationSentToBackground( final Context context)
  5. restoreToUserApp(Context context)
  6. getAppName(Context context)
  7. getAppPackage(Context context)
  8. getAppVersionCode(Context context)
  9. getAppVersionName(Context context)