1. Don't rely on sending custom http headers. These will often get mangled by the gateway.
2. Don't rely on sending custom http response messages. These will often get mangled by the gateway.
3. Don't rely on sending a custom body if your response is anything other than '200 OK'. For example, the body data you may send with a '400 Bad Request' response may get removed by the gateway or replaced by something generic.
4. Use 'connection.setRequestProperty ( "Connection", "close" );'
Some devices (notably GX30) don't like it otherwise.
5. Don't expect to read a -1 from the response input stream if the Content-Length header in the response has been set. This may cause your app to get stuck in an infinite loop (particularly a problem on Motorolas I found)
6. On SEk700 use canvas.setFullScreenMode( false ) before making the connection, if full screen mode is set the 'connect to internet'
dialogue will not be visible to the user and it will appear the app has frozen.
7. Most devices require different APN settings for java connectivity to work. Usually this is referred to as the 'internet' APN rather than the 'WAP' apn. Specific apn name/ username / password available from your network provider.
8. In my experience Sharp GX10i / GX30 connect OK with the default
(WAP) apn settings, no need to change them.
9. There may be problems with early GX10s connecting to a server that was not the server from which the MIDlet was downloaded. This is not an issue on GX10i.
10. On some Motorola phones there is a DNS setting under settings- >java settings. I had to clear this to get connectivity to work.
11. On some Motorolas if you call a new web session 'Java Session' it will get used by default when java connectivity is required.