I want to achieve something in my android application. I need to create a HEX representation of a String variable in my class and to convert it to byte array. Something like this :
String hardcodedStr = "SimpleText";
String hexStr = someFuncForConvert2HEX(hardcodedStr); // this should be the HEX string
byte[] hexStr2BArray = hexStr.getBytes();
and after that I want to be able to convert this hexStr2BArray
to String and get it's value. Something like this :
String hexStr = new String(hexStr2BArray, "UTF-8");
String firstStr = someFuncConvertHEX2Str(hexStr); // the result must be : "SimpleText"
Any suggestions/advices how can I achieve this. And another thing, I should be able to convert that hexString and gets it's real value in any other platform...like Windows, Mac, IOS.