尝试解析数据以在设备和测试服务器之间建立连接。 除了,我在String parsedMessage = (String)comm.parse(toParse).getPayload();
内(toParse)
上得到一条红线
parse(byte[]) in Communicator cannot be applied to (java.lang.String)
我试图将String toParse
更改为byte[] toParse
,它使红线消失了parse(toParse)
但byte[] toParse
变为红色,并显示错误"所需的字节[],找到java.lang.String">
Communicator comm = new
Communicatior(InstrumentationRegistry.getTargetContext());
String toParse = "88819188181A7";
String parsedMessage = (String)comm.parse(toParse).getPayload();
尝试像这样调用方法getBytes((:
String parsedMessage = (String)comm.parse(toParse.getBytes()).getPayload();