Skip to Content
This post is one from the category tips and tricks.  For performance reasons, one important rule in the user interface design for JSP MI based mobile applications for PDAs is to minimize the use of graphics. Graphics load slowly and Pocket Internet Explorer does not render graphics efficiently. But it is not always possible to avoid graphics completely. Before offering you a solution on how to load graphics faster and with less resources, I want to explain the way graphics are loaded in the “classical” way:

     

  1. The user clicks a link.
  2.  

  3. The html code of the page is sent from the MI client’s Tomcat webserver to the Pocket Internet Explorer (IE). The delivery of html code – even if it is done locally on the device – is done via http.
  4.  

  5. The Pocket Internet Explorer interprets the html code. If it finds a img tag, it sends a request to the local Tomcat (again via http) and it asks for the image file.
  6.  

  7. Tomcat receives the request. It looks into the file system and if the requested image is there reads it with a FileInputStream.
  8.  

  9. The image is sent via http to the IE.
  10.  

  11. The IE renders the image and displays it.
  12.  

So here we have some steps we can avoid: Instead of sending the file via http from one application to the other one on the same device, we let the IE read the image directly from the filesystem without the use of Tomcat. This will go faster and we will save very valuable memory. Example: Classic way:

Improved:

Now Tomcat is not involved anymore and we save the http request/response cycle and the memory otherwise required by the FileInputStream. As you will most likely use JSPs to create your html pages it is easy to use a constant to point to your folder that contains the images. So it can be change in one single location if the path is changing.  But enough for today, let’s get the Business in Motion!.  

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply