how to interconnect 2 mdlets and servlet??

hi ranchers can anyone let me know how can we connect 2 midlets and in turn connect to a servlet thnx Rajeev Sachdev

Rajeev Sachdev<br />(Sun Certified Java Programmer 1.4)<p>"Research is to see what everyone sees and thinking what no one has thought of"

Daryl Wilding-McBride

Author
Ranch Hand

Posts: 60

posted 14 years ago

Can you tell us more about what you need to do, especially the "connecting two midlets" part? To connect to a servlet from a midlet, you could do something like this: HttpConnection c = (HttpConnection)Connector.open(urlString); DataInputStream dis = c.openDataInputStream(); byte[] buffer = new byte[(int)c.getLength()]; dis.readFully(buffer); result = new String(buffer); This fragment should be in a try-catch-finally block, with a c.close() call in the finally block, just to tidy things up. [ July 19, 2003: Message edited by: Daryl Wilding-McBride ]