code: private boolean isFacebookAppInstalled() {
          boolean isInstalled = false;
          try {
              // An exception will be thrown if the package is not found.
              mContext.getPackageManager().getApplicationInfo(FACEBOOK_APP_PACKAGE, 0);
              isInstalled = true;
          } catch (PackageManager.NameNotFoundException e) {
              // Do nothing.
          }
          return isInstalled;
      }
docs: Checks if the Facebook native app is installed on the device.
  
  @return true if installed; false otherwise.