[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Using Images in HDML
Section 31 out of 67 total sections , Section 3 out of 3 sections in this chapter


Using images efficiently

The example in the previous section used a single static HDML deck to display several images. Although this works, it is not always the most efficient way to display multiple images. Because the images are provided by separate absolute URLs, the phone must make several requests to load the HDML decks--one request for the deck itself and an additional request for each image.

If you are using multiple images, you should consider including them in a digest; cards in the digest can display the images by specifying digest-relative URLs. This ensures that the images are all sent in a single response to a single device request. The potential disadvantage of this approach is that each time a deck in the digest is refetched, all of the images in the digest will also be refetched, regardless of whether they are already in the cache.

When you package multiple images in a digest, the device loads the images in the order in which you include them--that is, the first image you added to the digest gets loaded first, the image you added last gets loaded last.


Example: using Perl utilities to add images to a digest

The following Perl code demonstrates how to include the cards and images in Figure 4-1 in a single digest:


IMPORTANT     Digests that include images are subject to the same size limits as all digests. The size limit for an UP.Link digest is 1492 bytes.


[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Using Images in HDML
Section 31 out of 67 total sections , Section 3 out of 3 sections in this chapter


Copyright © 1999, Unwired Planet, Inc. All rights reserved.