Android与单片机通信常用数据转换方法
1. 将GB2312转化为中文,如BAFAC2DCB2B7→胡萝卜,两个字节合成一个文字
public static String stringToGbk(String string) throws Exception {
byte[] bytes = new byte[string.length() / 2];
for (int j = 0; j < bytes.length; j++) {
byte high = Byte.parseByte(string.substring(j * 2, j * 2 + 1), 16)