|
|
||
|
| ||
Part 4 Java XML Programmers Reference Chapter 11: XML Tools for Information Appliances October 15, 2001
Writing the XML Document The final step is to ask handle the yes/no button click. If yes is pressed, we must open the database and write the contact (received XML) as a new record. If no is pressed, we repaint the screen with the "Waiting for contact information
" message. As we've already seen, button clicks are handled by overriding the com.sun.kjava.Spotlet.penDown() event handler. If the exit button has been pressed, we register our "owner" the ContactBook object as the current Spotlet event listener (remember, there is only one Spotlet listening for events at a time), and tell ContactBook to paint itself. This effectively hands control back to the main menu. The owner is set in the ReceiveContact constructor: Summary In this chapter, we examined Java and XML on lightweight clients, also known as information appliances. We talked about where XML on lightweight clients stands today, and why we need XML on lightweights. Then we discussed the architecture of Java 2 Micro Edition: the application layer, the device profile layer, the configuration layer, and finally the operating system layer. Focusing more on the Connected Limited Device Configuration, as it is more "lightweight" than the Connected Device Configuration, we discussed the Java Kilobyte Virtual Machine, kjava, and kAWT. Next we reviewed parsers for lightweights. Pull parsers such as kXML and XPP hold a lot of potential for information appliances, but since there is no industry-accepted standard interface, we focused on DOM-style and SAX parsers. We covered two very different versions of NanoXML in-depth, as well as NanoXML's SAX interface. We also discussed MinML with its SAX interface. XSLT Compiler, by Sun Microsystems, was covered in detail. We wrote an XSL stylesheet, compiled a translet, and executed a small TroubleTicket application that used the translet with an input XML document. XSLTC's speedy execution and small size make it ideal for performing XSL transformations on information appliances. SOAP on information appliances is very appealing, but library support is limited currently. It might be best to write your own library if you can't wait until kSOAP or another small library matures. Finally, we built a peer-to-peer contact book application for the Palm OS using NanoXML, Java KVM, the Palm OS Emulator, and some GUI classes made available by Sun. This infrared beaming application prompted the user with a list of contact book entries to beam, while a receiving application waited for an XML document to insert into its contact book database. | ||
|
PAGE: 1 | 2 | 3 | 4 | 5 | 6 | 7 | FIRST PAGE |
||













