Wednesday Dec 21, 2011

Updating Java ME Applications

A new article up on otn/java, by Java ME expert Vikram Goyal, titled “Updating Java ME Applications,” demonstrates how easy it is to update the text, images, and source code for Java ME applications. Goyal explains that updating a Java ME application includes updating static data, such as text and images, as well as code components of the application. In the article, he develops a sample app that illustrates how to update an application.

As Goyal explains, “The article starts with the basics—updating simple text strings—and then moves to updating images. Finally, the article shows the easiest way to update the core application files, which Java ME makes quite easy. However, this ease can come at a price in terms of extra network traffic.”

Goyal concludes the article with some basic advice:

“If you don’t need to update the entire source code for your application, use the connection classes provided within the javax.io package, such as ContentConnection and HttpConnection, to update static data, such as text and images.

On the other hand, if you need to provide a mechanism for updating the entire source code, make sure you follow a valid update process on the server, and use platformRequest(String) with a URL that ends in jad to provide the updates. The device’s interface will then make sure the updates are applied by removing the old MIDlet and installing the new updated version.”

Read the complete article here.



Wednesday Nov 09, 2011

Working with the XML Parser API — JSR 172

Vikram Goyal’s article, “Working with the XML Parser API — JSR 172,” now up on otn/java, covers the basics of the XML Parsing API via a concrete example that uses SAX (Simple API for XML), a parsing method which is now preferred to the alternative method, and DOM (Document Object Model), which has a heavy memory footprint that led the XML Parser API to disallow its use in XML processing. “The XML Parser API,” explains Goyal, “defines the use of the SAX parser for parsing XML documents in resource-constrained devices.”

 

He explains through a working example what the SAX parser is, how it is defined by the API, and how best to use it.

 

From the article:

 

“In a nutshell, for the parsing of a custom XML document, you need to create a handler that extends the DefaultHandler class provided by the API. This custom handler is responsible for listening to the events from the parser and creating the model based on those events (and the supplied data). Your handler is responsible for validating the document and its data.”

 

Read the article.

 

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today