java - read_message in Bluetooth Chat sample -
i'm coding android app, , it's connected cc2540 usb dongle bluetooth. procedure that, when dongle sends string "o\r\n" phone, app must view string on edittext "ef". have changed message_read part in bluetooth chat sample android sdk:
private final handler mhandler = new handler() { @override public void handlemessage(message msg) { switch (msg.what) { case message_read: byte[] readbuf = (byte[]) msg.obj; if (readbuf.equals("o\r\n")) { // construct string valid bytes in buffer string readmessage = new string(readbuf, 0, msg.arg1); mconversationarrayadapter.add(mconnecteddevicename+": " + readmessage); } } } };
is code okay requirements ?
how implements edittext here in case ?
thanks in advance
Comments
Post a Comment