public static int fromVersionString(final String input){
  int dot_pos=input.indexOf('.');
  try {
    if (dot_pos > 0) {
      int major=Integer.parseInt(input.substring(0,dot_pos));
      int minor=Integer.parseInt(input.substring(dot_pos + 1));
      return (major << 8) + minor;
    }
  }
 catch (  NumberFormatException ignore) {
  }
  return 0;
}

public static int fromVersionString ( final String input ) { int dot_pos = input . indexOf ( '.' ) ; try { if ( dot_pos > 0 ) { int major = Integer . parseInt ( input . substring ( 0 , dot_pos ) ) ; int minor = Integer . parseInt ( input . substring ( dot_pos + 1 ) ) ; return ( major << 8 ) + minor ; } } catch ( NumberFormatException ignore ) { } return 0 ; }
transforms a string like " 1 . 2 " into an integer representing it .
