Preparing to tackle wireless development - Web Development - Techguide

Preparing to tackle wireless development

 

Summary

Wireless application development is similar to other development efforts, but it does have unique aspects. Here's a look at how you can use Java and XSLT for wireless development.

Events

Echelon 2012
June 11 and 12, 2012

University Cultural Centre, National University of Singapore

Startup Asia Jakarta 2012
June 7 and 8, 2012

12th Floor, Annex Building, Wisma Nusantara Complex, Jl. M.H. Thamrin No. 59 Jakarta 10350, Indonesia

MMA Forum Singapore
April 23-25, 2012

Grand Hyatt Singapore

Developing for wireless applications brings its own set of challenges, including a number of display and browser issues. In this three-part series, I'll explain how to use the Java APIs for XML Processing (JAXP), along with XML Stylesheet Language Transformation (XSLT), to solve some of those problems and build content that the wireless device can understand. I'll kick off the series by reviewing a few of the basics to show you what you're up against and where JAXP/XML/XSLT will come in handy.

Screen resolution
Back in the old days (does anyone remember 1994?), the cutting-edge technology was client-server GUI development with languages such as Visual Basic and PowerBuilder. One of the problems with early GUI development was that you never knew which monitor resolution to program for. If the application was viewed on a monitor using 800 x 600 resolution, it would not fit on desktops using a lower resolution. If the monitor resolution was high, your applications would be too small to see.

Internet development partially solved this problem. By using markup tags to define the GUI, the application could use more of a relative, as opposed to absolute, positioning. This meant that the GUI would resize somewhat when the user resized the browser. By default, Java applets also use this system of relative positioning.

So what’s the point? Screen resolution problems are an even larger issue on handheld devices. High-end PDAs such as the Handspring Prism have a resolution of 160 x 160 pixels—a far cry from traditional monitors that have a resolution of five times that much. Mobile phones, on the other hand, are on lower end of screen resolution. A Nokia 6185i has only five lines of resolution. So what do you do? Write completely different applications for each device? That’s not really feasible. But, by the end of this article, you'll see how you can use JAXP/XML/XSLT to regulate what content gets served to which devices.

Browser differences
With few exceptions, wireless applications are run within a microbrowser. These browsers come in all shapes and sizes but all have the same purpose: connecting to the Internet. So a microbrowser serves the same purpose as its larger, full-featured cousins, such as Netscape Navigator and Internet Explorer. And, like its cousins, microbrowsers may have varying support (or no support at all) for certain markup tags.

As a result, just because a wireless application will run in one microbrowser does not guarantee it will work in others. To further complicate your day, dozens of microbrowsers are currently being used. Your job is to make sure that your wireless application works in all of them. Again JAXP/XML/XSLT will help you with this daunting task.

XML basics
Remember that XML is a set of markup tags that describe the data, not the presentation (what the user sees). Almost never does the user see pure XML. XML is an intermediate technology that is transformed into viewable presentation tags such as WML or HTML. Where does the XML come from? Just about anywhere you want. It could be in something as sexy as a Java Byte Stream or as mundane as a flat file. Keep in mind that because XML is a new(er) technology, any language that can write flat files can generate it. (COBOL programmers are allowed to snicker here.) For the sake of simplicity, I will use XML in the form of a flat ASCII (read Notepad) file.

Transformations basics
When XML needs to be viewed, it must go through a transformation. The transformation refers to reading the raw XML file and then stripping the XML tags and replacing them with markup tags that can be understood by the browser. In the case of traditional browsers such as Internet Explorer, HTML tags will be used. In the case of microbrowsers, WML tags will be used. The beauty of transforming XML to the desired markup language is that only a single XML file is required. The resulting data can be formatted differently depending on which browser is requesting it.

So what defines the transformation? Not surprisingly, you define the rules of the transformation. How you do this can vary, but for the sake of simplicity, we'll place the transformation in a flat ASCII file. Most transformations are performed on the server in this fashion. Files that define the transformation rules are called style sheets and generally have an .xsl or. xslt extension.

Conclusion
At this point, you should have a good idea of the technologies involved in programming for wireless devices. In the next article, I'll provide some simple examples of transformations that utilize the Jaguar server platform, getting more complex as I go. In the final article, you'll learn how to build a robust wireless application using Jaguar.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment

ZDNet Asia Live

@YQLiauZDNetAsia So that's what I should do to make you do more stories....hmmmm

@EileenZDNetAsia Line 'em up!

@YQLiauZDNetAsia Already lined up...and a lot more waiting!

@EileenZDNetAsia sounds like they need to change biz models, since no one is paying for that stuff and piracy is eating their lunch.

Maybe I should play Words with Friends again. http://t.co/JQ92Bwap

RT @wenonalok: Fact: Korean music industry uses Swedish writers! #MM12

Sony to stop feature phone sales in India by Sept. Bold or foolish move? http://t.co/HfkHxaUY #li

Win Phone devs, how important is it to integrate Win Phone with Windows and Xbox Live platforms? http://t.co/Qr2YACzJ #li

Govt aid for staff training growing in importance http://t.co/C8aOMeNU http://t.co/erFSwAUB #arcavir

http://t.co/VNaUVSe1 Govt aid for staff training growing in importance: Governments' role in... http://t.co/ziZpIsyi http://t.co/wiqTBKkj

Govt aid for staff training growing in importance. http://t.co/9FftpZ9d

Sony Mobile yanks feature phones from India - ZDNet Asia: Zee NewsSony Mobile yanks feature phones from IndiaZDN... http://t.co/c9xuPaeR

RT @MarioKaestner: Mobile #CRM gives better ROI than social http://t.co/1VahI35K Gartner via @KANASoftware

Japanese e-commerce provider Rakuten expands SEA footprint with entrance into M'sia, after Thailand and Indonesia. http://t.co/Xm28UgUL #li

Panel at #mm12 say music licensing process complex, expensive, time-consuming in Asia. Is tat why the likes of iTunes isn't in this region?

The key for mobile operators is identifying the applications that are popular with subscribers on their network. They can then work partn...

7 hours ago by camcullen on Experience trumps content in apps monetization

So much as we know , MTK6575 extremely integrated frequency1GHz ARM Cortex-A9 processor, the superiority of 3G / HSPA Modem, and help the...

2 days ago by y15822137359 on 5 SaaS adoption speed bumps to avoid

I reckon your view: "CRM is strategy, not software", if a company replicating the approach uses in ERP implementation into CRM, what they...

3 days ago by wykoong on Gartner: Mobile CRM gives better ROI than social

This video will teach you about the Excel fill handle but also provide you with a workook to download... http://www.youtube.com/watch?v=...

3 days ago by TradeBrother on A quick fill handle trick for Microsoft Excel

waiting...

5 days ago by eapete on What should count in a company's market value?

Boy, you've opened a can of worms now.

Wait for the rants & raves.

5 days ago by eapete on What should count in a company's market value?

I was puzzling before this whether to replicate the success formula we executed for a financial institute, and come out with a standard s...

6 days ago by wykoong on Drop the egos, copy ideas, then innovate