Java tutorial
//package com.java2s; import android.util.Log; public class Main { public static void PrintHex(String Tag, byte[] buffer, int size) { String msg = ""; for (int i = 0; i < size; i++) { msg = String.format("%s 0x%02X", msg, buffer[i]); } Log.d(Tag, "HexData=[" + msg + "]"); } }