I've developed a client application in j2me and nokia emulators: this app get mapi "text/text" (simple ASCII document) informations by a server and shows this informations on screen. My problem is: in emulators (any nokia emulator (6600, 7210, S40), most siemens and sonyericsson) the app works fine, but in my devices (nokia 3200 and nokia 7250i) i receive a connection error 502 (HTTP_BAD_GATEWAY).
I've developed a test method: this method works on emulators but not in devices...
Unfortunately, I don't have a suggestion for your code.
However, I have a suggestion for posting code.
We have a "CODE" tag, that can be created by clicking the CODE button, which is located under the "Add Reply" button, along with URL, BOLD, etc. buttons
This tag will enable you to keep your formatting for your code, like indentation, and makes your code readable. The way your code is posted makes it difficult to read, and therefore, more difficult for us to help you.
Often on devices you need to configure a web profile instead of a wap one. In fact some telco operators permit the network connections only if a web profile is used. Are you testing your application in Italy? (... I guess it from your name...). Let me know if you need more information on profiles to use in italian devices. Ed