I got some important question:
I need to send a Hexadecimal value stored in a bye[] (max. 4 byte) witch i have typed in in my textview of my android phone application.
mSendButton.setOnClickListener(new OnClickListener() { // clickonbutton to send data
public void onClick(View v) {
// Send a message using content of the edit text widget
TextView view = (TextView) findViewById(R.id.edit_text_out);
byte[] message = view.getText().toString().getBytes();
sendMessage(message); // message needs to be a byte []
}
});
for example when i type in 0x1020 and press send button i want to have a byte [] = {0x1020}.
The toString function (line 5) converts the raw incoming bytes into other values. A legal replacement would be:
CharSequence values= view.getText();
It's imortant that the first 2 value's are 0x and after these there are 2 or 4 bytes (hex presentation) of data.
Thank you verry much for taking some time to help me !