Convert String to Hexadecimal
You cannot convert a string to hexadecimal like that, only a number can be formatted with %016x
.
You can fix this by parsing "123456"
:
String.format("%016x", Integer.parseInt("123456"));
convert string to hexadecimal string
String x = "131008130225002";
System.out.println(new BigInteger(x).toString(16));
The output is 7726b510936a.
Related Topics
Get Driving Directions Using Google Maps API V2
Execute Shell Command from Android
Read a PDF File from Assets Folder
Iso 8601 String to Date/Time Object in Android
How to Unzip Files Programmatically in Android
Hiding Strings in Obfuscated Code
Convert JSON Array to Normal Java List
How to Check If an App Running on Android
Get Battery Level and State in Android
How to Add a Textview to Linearlayout in Android
Recyclerview Horizontal Scrolling to Left
Invoking Bash from Java Interactively
Shuffle Multiple Files in Same Order
Using Xdg Directory Specification on Java Application
Java Version Still Showing as 1.4 Linux
How to Abort the Installation of an Rpm Package If Some Conditions Are Not Met in Specfile
What Would Cause a Java Process to Greatly Exceed the Xmx or Xss Limit