code: public static boolean isPackageAvailable(@NonNull Context context, @NonNull String packageName) {
          return (getPackageInfo(context, packageName) != null);
      }
docs: A safe method to check if an app is installed.
  
  @param context to be used to check for package
  @param packageName of the app to be checked.
  @return true only if app using packageName is installed.