I’m trying to get the value of an EditText box and convert it to a byte array for use in nfc writing. Basically, I want to be able to write to an NFC tag just from an EditText box. I’ve tried simple stuff like .toString() and UTF-8 encoding, but my issue seems to be in getting a String value from the Editable. Anyone have experience here?
Edit: Relevant code here:
EditText msgInput = (EditText) findViewById(R.id.editText1);
...
String msg = msgInput.getText().toString();
Log.i(TAG, "msg: " + msg);
byte[] bytes = msg.getBytes();
Log.i(TAG, "bytes: " + bytes);
messagePayload = bytes;
I enter ‘stuff’ (without quotes) into my edittext, then try to write. This gives two logcat outputs:
msg: stuff
bytes: [B@412e9e80
Probably,