Another way to convert int to hex .
String hex = String.format("%X", int);
You can change the capital letter X to x .
Example:
String.format("%X", 31) results 1F .
String.format("%X", 32) results 20 .
Wit Jan 13 '16 at 9:10 2016-01-13 09:10
source share