• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Wtk Emulator = OK... Nokia phone = NOT OK??

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i just partly finished my project that using socketConnection to connect to my server that listen to some port. Using the wtk emulator the code works just fine. I can connect and send command to my server.

But when i install the same jad file.. the application can run/ connect but CANNOT send any data to the server. Then, I try to capture the data by inputStream same thing happen.

I surfing 4 info and find out nokia got some problem with input/outputStream. But i found application called RemoteDesktop(www.desktopmobiles.com) that using j2me working fine sending/receiving data to server, i works on my nokia 6260 also.

So anybody know the solution?..pls help me. Is there any third party API that can make it work on any phone like the RemoteDesktop apps do?...
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not see any question.

But if you are looking for app that is similar to RemoteDesktop4Mobiles, and you want to familiarize with its source code, you should try this one: http://j2mevnc.sourceforge.net
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have also same problem If u find the solution pls share with me...
I got the exception in nokia 6230i is
java/io/IOException
at com.sun.midp.io.j2me.socket.Protocol.connect(+236)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+68)
at com.sun.midp.io.j2me.socket.Protocol.openPrim(+222)
at com.sun.midp.io.InternalConnector.openPrim(+452)
at com.sun.midp.io.InternalConnector.open(+195)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+5)
 
rashidi ahad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to Marcin Zduniak

the question is, why i can run the coding on wtk emulator but not on the nokia devices (n6260)

to Maddi Ranjan

im not sure that ur problem is same with me or not..
but i hv found solution for my problem.

for nokia to send data thru outputstream u must flush the data and close the connection. then u open connection to the same server and execute the inputStream to get the respond message process by the server from your previous data.

something like this..

//open conn
sc = (SocketConnection) Connector.open("socket://" + xconnStr);
//prepare data to be send
data = "some command";
DataOutputStream os = sc.openDataOutputStream();

os.write(data);
os.flush();
os.close();

/-------------------------------------------------------------------------
//diff method or class

//then, to receive respond from the host..
//open conn
sc = (SocketConnection) Connector.open("socket://" + xconnStr);
InputStream is = sc.openInputStream();


// read server response
StringBuffer sb = new StringBuffer();
int c = 0;
while ( ( (c = is.read()) != '\f') && (c != -1)) {
sb.append( (char) c);
if (c == -1) {
break;
}
}
return sb.toString();
[ June 30, 2005: Message edited by: rashidi ahad ]
 
Maddi Ranjan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have also find out the solution of my problem. Actually in Nokia 6230i have limit of output buffer at a time it can write upto 60kb. But if ur file size is grater than 60kb it trows this exception.
Any way I find out the solution, just write the data chunk by chunk on output stream.
Thanks
reply
    Bookmark Topic Watch Topic
  • New Topic