code: static String getPackageName(Context context) {
          String packageName = "";
          if (context != null) {
              try {
                  final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
                  packageName = packageInfo.packageName;
              } catch (Exception e) {
                  PrefHelper.LogException("Error obtaining PackageName", e);
              }
          }
          return packageName;
      }
docs: Get the package name for this application.
  @param context Context.
  @return {@link String} with value as package name. Empty String in case of error