Android examples for java.lang:Hex
Format byte array To Hex String using String.format
import android.text.TextUtils; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main{ private static String bytesToHexString(byte[] bytes) { StringBuffer sb = new StringBuffer(); for (byte b : bytes) { sb.append(String.format("%02x", b)); }/*from w ww.j a va 2 s . c o m*/ return sb.toString(); } }