Welcome!

Wireless Authors: Yeshim Deniz, Maureen O'Gara, John Hornsby, John Savageau, Onkar Singh

Related Topics: Wireless

Wireless: Article

Java and SMS

Java and SMS

You're reading a huge amount about wireless technologies in the press these days. Everywhere you look, somebody, somewhere, is doing something cool with their application and the world of WAP. The very fact that you're reading this magazine attests that you're at least toe dipping into this new world of no-wires! But how do you actually start using it with your own programs?

A good question, and one I'm sure many of you have probably asked at some point in all this hype. In this article I'm going to take you through a complete case study of one such solution that we here at n-ary have delivered for one of our partners - ShopSmart.com.

Project Specification

Before venturing further, let's have a quick look at the problem we're attempting to solve with our wireless solution. Now before you start converting everything you've ever coded into a wireless solution, decide first of all whether it'll be useful running in such an environment. Contrary to popular belief, not everything should go wireless. There's a fine balance, and as you'll soon discover, the actual functionality available remotely is very disappointing.

Our partners, ShopSmart.com, provide a comprehensive real-time comparison engine for shoppers. For example, say you want the latest Robbie Williams CD. It'll easily tell you which merchant is selling the CD for the cheapest price. Simple as that. Now going to a wireless platform was a logical evolution for this application. Imagine, if you will, standing on the floor of Virgin, CD in hand, poised to buy. But you wonder if it really is a good value. Having the ability to check it then and there using your mobile phone would be a fantastic feature. This is what the Internet is all about after all: to make things easier on us. But carrying around a PC to give you access to this world isn't terribly convenient.

The easiest way, of course, is to provide a WAP interface to the site. That didn't prove too difficult, and within a week we had a complete WAP-able interface to the core comparison engine. But the problem with WAP is that it's crap.

WAP has oversold and underdelivered. The functionality that's available is very restrictive and not very exciting. The ability to surf the net from your cellular phone sounds a lot cooler than it actually is. Sadly, it's not what it's cracked up to be, especially so in this country, the UK, where it's rather expensive, slow, and prone to dropping connections. Another major stumbling block is the availability of WAP-enabled phones in comparison to the number of cell phones in use. The number that has WAP functionality is small. That number is increasing as each week rolls by, of course, but not as fast as you'd think.

What's the alternative?

A technology that's seen an explosive growth in use is that of the SMS message. SMS - Short-Message-Service - is the ability to send a small text message of 160 characters to another SMS-enabled device. It's inexpensive, and the majority of digital phones have SMS capability. For example, according to a report from the BBC in June 1999, just under 600,000 SMS messages were sent that month. Compare that to the 500,000,000 messages sent a year later, in June 2000. Vodafone, a major operator in this country, announced that the majority of its income comes from the sending of SMS messages, not voice calls.

SMS is a good way to capture a large mobile base of consumers. So how do you go about providing an interface to it? Back to ShopSmart.com.

In our example we want the user to send a message to a predefined number that will reply with the cheapest price. The user looking to find the cheapest price for a particular book, for example, would send the ISBN number.

B,0201066734

The comparison engine would return the message to the user's mobile phone.

The overall process has taken under 30 seconds and cost the user, dependent on the network, between 4p and 12p (British pence). Much quicker and cheaper than the equivalent WAP transaction.

Software Design

Once we knew the physical sending and receiving of messages wasn't going to be a problem, we designed a simple suite of classes that allowed us to integrate the box easily into any Java environment. It's worth pointing out that since the box is controlled via the serial port, the design relies on the Java Communications API
to handle all the low-level communications. Sun only supports the Windows and Solaris environments for this API, but if you go to www.interstice.com/~kevinh/linuxcomm.html, you'll find an implementation for Linux. We've used this version and it works wonderfully well. No major problems to report, even at high speeds.

The smsDriver layer uses the Java Communications API to provide a wrapper to the underlying unit. This class provides all initialization and event handling for all consumer classes. The smsDriver does very little buffering; its main purpose is to ensure the safe delivery of a single message in and out of the physical hardware.

The smsManager layer handles the bulk of the messages and ensures that the smsDriver doesn't get overloaded. It provides all the buffering and time stamping of messages and formats them for ease of use by other classes in the system.

Sadly, I'm unable to show you any physical code due to license agreements and what have you, but the overall operation isn't that complicated because of the ease of communication with the underlying SMS box.

Conclusion

The wireless revolution has made this a wonderful time to be living in. However as with all revolutions, choose your move wisely. Don't go blindly into the world of WAP without looking first at the alternatives. The world of SMS still has a lot to offer and I believe it'll be around for a number of years.

SMS offers a great way of getting announcements out to users, and although not a license to spam, it can provide a very valuable service to your customers.

So give it a bash.

SMS Delivery Agent

Sending and receiving SMS messages can be a complicated procedure. Let's look at the different ways you can do it. If you know a particular network provider's access number - the number your phone delivers the SMS message to - you can simply dial it up using a standard modem and follow the onscreen instructions. It's that easy. The problem comes when you want to receive a message.

The first port of call is the mobile network providers themselves. They'll generally provide you with a service that will enable you to send large volumes of SMS messages back and forth. There are a number of disadvantages with this system, mainly that the operators are tremendously territorial about their network, disabling the capacity to send messages to callers using another mobile network. In addition, the cost of the service is extremely high, with a quarterly rental and in some cases a separate leased-line installation to handle only SMS messages. At the time of this writing, there is no UK operator offering this high-volume service via the Internet, which is truly a shame, in my opinion. This expensive barrier to entry is discouraging many of the smaller businesses from opening up services to their clients.

An alternative is to physically connect your mobile phone to the PC. But this route is also fraught with problems, such as poor reliability with the actual phone and a poor interface to the phone's feature.

A third method for enabling the sending and receiving of messages is to look for a specialized piece of hardware designed for the task. We found one such device, manufactured by a company based in Northern Ireland, Cab-Trak Limited, which makes the handling of SMS messages an absolute dream.

This box plugs into a free serial port and gives an easy-to-use command-line-driven interface. It buffers up to 32 messages, 16 in, 16 out. Think of it as a mobile phone with extra intelligence. It accepts a standard SIMM card that will plug it into a particular cellular network and assign it a telephone number. The box comes with an aerial that can be placed up to 15 feet away from the unit and will handle 20-40 messages a minute, which for the majority of companies is more than enough to prove whether there's a market for their services on SMS.

For more information on this rather sexy piece of technology, head on over to www.cab-trak.com for more details.

More Stories By Keith Douglas

Keith Douglas, a senior developer at n-ary (consultancy) Ltd., has wide range of skills and interests. With a formal background in marketing, Keith helps develop and bring new n-ary products to market.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.