public static boolean checkMD5(final String md5Hash,final File file){
  if (TextUtils.isEmpty(md5Hash) || file == null || !FileUtils.isReadable(file)) {
    Log.e("Given String is empty or File is NULL or File is not readable");
    return false;
  }
  final String hash=getMD5(file);
  if (hash == null) {
    Log.e("calculated hash is NULL");
    return false;
  }
  return hash.equalsIgnoreCase(md5Hash);
}

public static boolean checkMD5 ( final String md5Hash , final File file ) { if ( TextUtils . isEmpty ( md5Hash ) || file == null || ! FileUtils . isReadable ( file ) ) { Log . e ( "Given String is empty or File is NULL or File is not readable" ) ; return false ; } final String hash = getMD5 ( file ) ; if ( hash == null ) { Log . e ( "calculated hash is NULL" ) ; return false ; } return hash . equalsIgnoreCase ( md5Hash ) ; }
checks if given hash is the same for given file - helps to detect file changes
