03.16.06

HTTP=Hyper Text Transfer Problems

Posted in Generelt at 10:22 by Morgan

Been doing some programming these last days (finally!), which means that I am on schedule with the project. Added functions to select a track and view detailed information, and also to type in a comment and send it back to the server using HTTP POST. Created simple status indicators showing track load status and map load status (none, currently loading or error).

Used to have the IP address of the server (my laptop) hard-coded in the client, but this didn’t work well as my laptop changes its IP adress frequently. Added user-interface to type in URL of server manually. This user interface appears as the application is started, to avoid lagging problems (described below). The URL is stored in persistent storage, so that as long as the server keeps the same IP adress, the user only has to press OK on this dialog.

Frustrating issues
- The J2ME user interface components (javax.microedition.lcdui.*), especially some Command items, are handled strangely on Nokia phones. It creates a menu “options”, even if it is only one item to put there..
- Seems that if a HTTP server is not available, all threads are frozen in a time-out. However, as far as I can tell, this only happens on the simulators, and not the real phone.
- In HTTP POST requests, NetBeans mobility pack DefaultColorPhone simulator uses “Transfer-Encoding: chunked”, whereas Nokia uses normal encoding. My server now handles both, but who knows what will appear in other mobile devices, “Transfer-Encoding: gzip”?
- Decided to not rely on the time on the client. Using System.currentTimeMillis() gives a different results than expected on the Nokia phones. After looking into the problem, it seems to me that the phone uses a “GMT-13″ timezone..
- Unable to draw using transparency. Had to use a png to create a simple cursor ..

Joyful moments
- Run multiple clients, and see that a comment written on one client appears on the other
- Found the reason why no tracks were visible on the Nokia client (time problems..)
- Start up the client, and see for the first time that information has been sucessfully recovered from persistent storage.
- See my .png picture appear on screen!

Below are a couple of screendumps from a simulator:

Screen showing map and simulated tracks. Notice the “T” in the upper right corner. This indicates that the application is currently loading tracks. The red brackets are the track selector.


Screen showing track details. The user can type in comment and send back to server.

Leave a Comment