
|
If the latency of the wireless network is reasonably small, the user of the MIDP client would get the impression that his/her mobile device is able to draw complex graphs using constants like pi and e, trigonometric functions, logarithms, and even decimal numbers (floats). As you probably know, neither floating points nor these mathematical functions are supported in the CLDC 1.0 configuration. For this reason, MicroGraph not only shows a simple technique to perform client-server networking over HTTP, but it also demonstrates how you can easily extend the limits of the CLDC/MIDP platform by moving some procedures to the server side. Note: To run the sample code you need to have an HTTP server. There are many ways to set up an HTTP server and in the sample we present only one of them. The server side of MicroGraph is a java servlet (named MicroGraphServlet) running on top of a Tomcat servlet engine (http://jakarta.apache.org/tomcat/). An ordinary Apache HTTP server with a servlet engine would also do the work. The MicroGraphServlet uses the JEP library from Singular Systems (http://www.singularsys.com/jep/) to create instances of MicroGraph's EquationParser class that can parse given equation strings and convert the calculated values to screen coordinates adapted to the client device. If one or more of the equations is illogical then a response message will be set up triggering an alert on the client side informing of the invalid equation. |
Copyright © 2001 - 2009 Sony Ericsson Mobile Communications AB. All Rights Reserved.