08-13-2010 07:08 AM - edited 08-13-2010 07:12 AM
Hello everybody.
I am developing an application that connects to a server that I programmed and is responsible for receiving data that the phones send. Communication with the server I have implemented in cell phones through sockets. By using the J2ME APIs I tested the application in SonyEricson Mobile, Nokia and LG and it works perfectly, however when I run on the application in the BlackBerry that I have (BB 8520) although it says it has sent the data to the server, the server receives nothing from the BlackBerry. I have tried every possible connection parameters but there is no way that the program actually send the data, however, in the emulator if it works and the server receives the data. I consulted the forums and aprarentemente my implementation is correct and should work, but I do not know what else to try and I wonder if someone can give me some ideas of what might be done to solve the problem.
From now attached a piece of code if can help someone to identify the problem:
For the parameter PARAM I used the following strings
/*
A. PARAM = ";deviceside=true;apn=internet;tunnelauthusername=
B. PARAM =";deviceside=true;apn=internet;tunnelauthusername
B. PARAM =";deviceside=true;apn=internet";
D.PARAM =";deviceside=true";
E.PARAM =";deviceside=false";
F.PARAM ="";
*/
SocketConnection _socketClient;
OutputStreamWriter flujoSalida;
boolean conectado;
try {
String ConnString = "socket://Server : port" + PARAM;
_socketCliente = (SocketConnection)Connector.open(ConnString);
conectado = true;
if (conectado) {
flujoSalida = new OutputStreamWriter(_socketCliente.openOutputStream
String reporte = "Message I want to send";
flujoSalida.write(reporte, 0, reporte.length());
flujoSalida.flush();
flujoSalida.close();
_socketCliente.close();
}
}
catch (SecurityException ex) {ex.getMessage()); }
catch (ConnectionNotFoundException ex) { ex.getMessage()); }
catch (IOException ex) {}
catch (Exception ex) {ex.getMessage()); }
In the emulator works when used as PARAM D. The BlackBerry send the information apparently when I use the D option. In cases A, B, C returns me error I / O Time Out.
In advance thank you very much for the time you read this post. I hope someone can help me
08-13-2010 07:44 AM
Have you tried BIS-B or whatever the RIM approach is called? It is supposed to
provide carrier independent stuff and seems to work better in general than
deviceside-true but what errors were you actually seeing on real device? Always
a timeout? Depending on the carrier if you, gasp, go to multiple hosts, eventually
you usually get something like port already bound or dns error but not sure if
BIS-B fixes this or not since we finally went to sockets+proxies for everything.
on vz anyway deviceside=true works for a while anyway,
08-13-2010 07:50 AM
Have you read this article, especially the section on Direct TCP, which seems to be what you are trying to use?
Since you are trying to specify APN information in your program, you should also read this:
Now the question is, are you using correct APN information for your network?
What is specified in your device's TCP Options?