Well I got some problems...
I sould send a TCP message to a busineslogic which detect the message and react. So for example if i send the message "request_complete_list" the busineslogic will send me some informations back! I´m working on Windows 7 with the Eclipse + Android SDK. The businesslogic running on Linux.
The other workers worked with some QStrings and used the method .toAscii() because the allowance which i got is to send all messages as Ascii.
They used a command like this:
- Code: Select all
Socket->write(QString(QString("request_complete_list").toAscii()+"\x04").toAscii());
I´m sending the message like this:
- Code: Select all
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStream Writer(s.getOutputStream())),true);
String test = "request_complete_list\\x04";
out.println(test);
The problem is the busineslogic just react if the string is correct. So if I´m sending a wrong message i can´t see the problem...
Maybe some of you know how i can solve the problem?! I think it could be because the message i send with out.println(test) is a String in Unicode? and not in Ascii...
I also tried some workaround:
- Code: Select all
ByteBuffer buffer1 = ByteBuffer.allocate(100);
for(int i = 0; i < test.length(); ++i)
{
char c = test.charAt(i);
int j = (int) c;
buffer1.putInt(j);
}
out.println(buffer1.array());
But no result...
So please if some of you have any idea just post it...