Alternative of DatatypeConverter.printHexBinary(byte[] array) and DatatypeConverter.parseHexBinary(String str) in Android

You are probably better off using the hexadecimal encoding/decoding found in the Apache commons codec library. Please make sure you are using the correct version of the library though, for more information look here


For android (gradle) dependencies just use

implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.12-b140109.1041'
implementation group: 'xerces', name: 'xercesImpl', version: '2.12.0'