Моя проблема решена с помощью этого кода:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;
import javax.microedition.io.*;
StreamConnection connection = (StreamConnection)
Connector.open("socket://IP:Port");
PrintStream output =
new PrintStream(connection.openOutputStream());
output.println("Request");
output.flush();
InputStream in = connection.openInputStream();
int ch;
String recx;
while( ( ch = in.read() ) != 13 )
{
recx = recx + (char)ch;
}
in.close();
output.close();
connection.close();