Printer Friendly
The Free Library
18,914,768 articles and books
Member login
User name  
Password 
 
Join us Forgot password?

Wireless software design techniques. (Database And Network Intelligence).


Software developers who develop applications to run on large powerful systems become used to the luxury virtually unlimited memory and processing power. They face a new set of obstacles when they must work within the limited resources available in mobile wireless devices, with their small screen size, memory, and processing power. Developers also face environmental challenges posed by the devices; mobility and by wireless networks, which typically offer lower bandwidth and less reliability than wired networks, These limitations require developers to think differently about user interface, processing power, memory management, and exception handling.

Consumers too have become accustomed to the power and flexibility of larger systems. Both average consumers and high-end corporate users want devices with applications that are simple, intuitive, and reliable.

Developing applications for devices with limited resources requires skillful skill·ful  
adj.
1. Possessing or exercising skill; expert. See Synonyms at proficient.

2. Characterized by, exhibiting, or requiring skill.
 developers who are willing to learn and understand how the wireless environment operates, and able to make intelligent decisions regarding software architecture and performance issues.

The purpose of this article is to enlighten en·light·en  
tr.v. en·light·ened, en·light·en·ing, en·light·ens
1. To give spiritual or intellectual insight to:
 users about concerns they should keep in mind when developing Java 2 Micro Edition (J2ME (Java 2 Platform, Micro Edition) A version of Java 2 for cellphones, PDAs and consumer appliances. J2ME uses the K Virtual Machine (KVM), a specialized Java interpreter for devices with limited memory. ) applications.

Constraints on Wireless Applications

The explosive growth of the market for wireless devices is stimulating widespread efforts to adapt almost any technology ever developed for desktop computers to handheld devices connected to a wireless network. The challenge is not straightforward.

First of all, wireless applications must work within the daunting daunt  
tr.v. daunt·ed, daunt·ing, daunts
To abate the courage of; discourage. See Synonyms at dismay.



[Middle English daunten, from Old French danter, from Latin
 constraints of the devices themselves:

* Memory: Devices such as cellular phones and two-way pagers have limited amounts of memory, obliging o·blig·ing  
adj.
Ready to do favors for others; accommodating.



o·bliging·ly adv.
 you to consider memory management most carefully when designing application objects.

* Processing power: Wireless devices also have limited processing power (16-bit processors are typical). You must recognize that elaborate tasks may take an unacceptable time to complete.

* Input: Input capabilities are limited. Most cell phones provide only a one-hand keypad A small keyboard or supplementary keyboard keys; for example, the keys on a calculator or the number/cursor cluster on a computer keyboard. See programmable keypad.  with twelve buttons: the ten numerals, an asterisk (1) See Asterisk PBX.

(2) In programming, the asterisk or "star" symbol (*) means multiplication. For example, 10 * 7 means 10 multiplied by 7. The * is also a key on computer keypads for entering expressions using multiplication.
 (*), and a pound sign (#).

* Screen: The display might be as small as 96 pixels wide by 54 pixels high and I bit deep (black and white). The amount of information you can squeeze into such a tight screen is severely limited.

It is too easy to focus on the limitations of the devices themselves and forget that the wireless environment imposes further constraints:

* Wireless networks are unreliable and expensive, and bandwidth is low. They tend to experience more network errors than wired networks.

* The very mobility of wireless devices increases the risk that a connection will be lost or degraded de·grad·ed  
adj.
1. Reduced in rank, dignity, or esteem.

2. Having been corrupted or depraved.

3. Having been reduced in quality or value.
. In order to develop efficient and reliable wireless applications, as you plan them you need to keep these constraints in mind, asking yourself the following questions:

* What impact do devices with limited resources have on application design?

* How important is it to develop applications that are platform-independent?

* What security issues should I be aware of?

Challenges for Wireless Developers

As I mentioned earlier, developing applications for mobile wireless devices poses several challenges that developers of wireless applications should be aware of. Here I present some crucial challenges and offer hints for developers. You should prepare yourself to handle these challenges if you want your applications to function correctly in the wireless environment.

1. Transmission Errors

Messages sent over wireless links are exposed to interference (and varying delays) that can alter the content received by the user, the target device, or the server. You must ensure that your application is prepared to handle these problems. Transmission errors may occur at any point in a wireless transaction and at any point during the sending or receiving of a message. They can occur after a request has been initiated, in the middle of the transaction, or after a reply has been sent.

Wireless network protocols may be able to detect and correct some errors, but you need to come up with error-handling strategies that address all the kinds of transmission errors that are likely to occur.

2. Message latency

Message latency--the time it takes to deliver a message--is primarily affected by the nature of each system that handles the message, and by the processing time needed and delays that may occur at each node from origin to destination. As a developer, you need to take message latency into account, and keep the user informed of processing delays Processing Delay

Time a selling firm takes to record receipt of a payment and deposit it.
.

It is especially important to remember that a message may be delivered to a user long after the time it is sent. A long delay might be due to coverage problems or transmission errors, or the user's device might be switched off or have a dead battery. Some systems keep trying at different times, to transmit the message until it is delivered. Other systems store the message, then deliver it when the device is reconnected to the network. Your concern here is to avoid sending stale information, or to make sure your users are aware that it is not up to date. Imagine the possible consequences of sending a stock quote that is three days old, without warning the user!

3. Security

Any information transmitted over wireless links is subject to interception. Some of that information could be sensitive, such as credit card numbers and other personal information. The solution needed really depends on the level of sensitivity. To provide a complete end-to-end security solution, you must implement it on both ends, the client and the server, and assure yourself that intermediary systems are secure as well.

One solution to consider when handling highly sensitive Adj. 1. highly sensitive - readily affected by various agents; "a highly sensitive explosive is easily exploded by a shock"; "a sensitive colloid is readily coagulated"  information is encryption The reversible transformation of data from the original (the plaintext) to a difficult-to-interpret format (the ciphertext) as a mechanism for protecting its confidentiality, integrity and sometimes its authenticity. Encryption uses an encryption algorithm and one or more encryption keys. : the sender encrypts the data before transmitting it over the wireless link; the authorized receiver receives the encrypted en·crypt  
tr.v. en·crypt·ed, en·crypt·ing, en·crypts
1. To put into code or cipher.

2. Computer Science
 data and decrypts it using a key provided.

E-commerce applications are already successfully using the secure HypterText Transfer Protocol (HTTPS (1) (HyperText Transport Protocol Secure) The protocol for accessing a secure Web server. Using HTTPS in the URL instead of HTTP directs the message to a secure port number rather than the default Web port number of 80. ), which is HTTP HTTP
 in full HyperText Transfer Protocol

Standard application-level protocol used for exchanging files on the World Wide Web. HTTP runs on top of the TCP/IP protocol.
 over the Secure Sockets Layer (networking, security) Secure Sockets Layer - (SSL) A protocol designed by Netscape Communications Corporation to provide secure communications over the Internet using asymmetric key encryption.  (SSL (Secure Sockets Layer) The leading security protocol on the Internet. Developed by Netscape, SSL is widely used to do two things: to validate the identity of a Web site and to create an encrypted connection for sending credit card and other personal data. ) Web security protocol developer by Netscape. SSL works nicely with e-commerce and there are hopes it will be used for m-commerce as well. Sun has been working on a stripped-down version of SSL called kSSL, and has already delivered it as part of the MIDP (Mobile Information Device Profile) A programming interface (API) for cellphones and pagers for the Java 2 Platform, Micro Edition (J2ME). It provides support for a graphical interface, networking and storage of persistent data for "MID Profile" applications,  1.0.3 reference implementation and the J2ME Wireless Toolkit 1.0.3. Quite apart from the KSSL initiative, some lava-enabled devices that support SSL are already available from NTT DoCoMo (NTT Mobile Communications Network, Inc., Japan) Founded in 1991, NTT DoCoMo is a spinoff of Japan's NTT (Nippon Telegraph and Telephone Corporation) which provides wireless services, including cellular, paging, satellite and maritime and in-flight telephone services.  and Motorola.

Cryptography is outside the scope of this article. If you are interested in encrypting data over wireless links, 1 recommend that you take a look at the Bouncy Castle Bouncy Castle
Noun

Trademark a very large inflatable model, usually of a castle, on which children may bounce at fairs, etc.

bouncy castle® ncastillo inflable 
 open source project for Lightweight Cryptography APIs for J2ME. You can find a tutorial on Bouncy Castle APIS in Chapter 12 Protecting Network Data in Jonathan Knudsen's book on wireless Java.

Hints and Guidelines

The section below offers hints and guidelines you will find useful when developing wireless applications:

* Environment. Do some research up front. You must first understand the needs of your potential users and the requirements imposed by all networks and systems your application will rely on.

* Architecture. The architecture of your application is very important. No optimization techniques will make up for an ill-considered architecture. Your two most important design goals should be to minimize the amount of data transmitted overt the wireless link, and to anticipate errors and handle them intelligently.

* Application partitioning Separating an application into components that run on multiple servers. Programming languages and development systems that support this architecture, known as "three-tier client/server," may allow the program to be developed as a whole and then separated into pieces later. . You need to think carefully when deciding which operations should be performed on the server and which on the wireless device. MIDlets allow you to locate much of an application's functionality on the device; it can retrieve data from the server efficiently, then perform calculations and display information locally. This approach can dramatically reduce costly interaction over the wireless link, but it is feasible only if the device can handle the processing your application needs to perform.

* Data representation. Data can be represented in many forms, some more compact than others. You should consider available representations and select the one that requires fewer bits to be transmitted. For example, numbers will usually be much more compact if transmitted in binary forms Binary form is a way of structuring a piece of music into two related sections, both of which are usually repeated. Note that Binary is also a structure used to choreograph dance.  rather than string representations.

* Message latency. In some applications, it may be possible to do other work while a message is being processed. If the delay is appreciable--and especially if the information is likely to go stale--it is important to keep the user informed of progress. Design the user interface of your applications to handle message latency appropriately.

* Interface simplicity. Keep the application's interface simple enough that the user seldom needs to refer to a user manual to perform a task:

1. Reduce the amount of information displayed on the device.

2. Make input sequences concise so the user can accomplish tasks with the minimum number of button clicks.

3. Offer the user selection lists.

Performance-Driven Programming

When developing applications for mobile devices with a small footprint, it is crucial to make your applications run faster. The less time your application takes to run, the happier your customers are going to be. Here are some guidelines to help you optimize performance:

* Do not initialize To start anew, which typically involves clearing all or some part of memory or disk.  objects to null A character that is all 0 bits. Also written as "NUL," it is the first character in the ASCII and EBCDIC data codes. In hex, it displays and prints as 00; in decimal, it may appear as a single zero in a chart of codes, but displays and prints as a blank space. . That chore is handled automatically.

* Wherever possible, use local variables instead of class members. Access is quicker.

* Minimize method calls. The Java Virtual Machine A Java interpreter. The Java Virtual Machine (JVM) is software that converts the Java intermediate language (bytecode) into machine language and executes it. The original JVM came from the JavaSoft division of Sun. , JVM See Java Virtual Machine.

JVM - Java Virtual Machine
 loads and stores a stack frame stack frame - activation record  every time it calls a method. For example, instead of doing something like this ...
for(int i=0;i<obj.length; i++) {
  // do something with array elements
}


... where the length of the array is evaluated every time the loop iterates, it is more efficient to define a local variable and call the accessor only once:
int len = obj.length;
for(int i=0; i<len; i++) {
  // do something with array elements
}


* Minimize object creation. Object creation leads to object destruction and reduces performance. Instead, design objects that can be recycled. Instead of creating return objects inside of methods, consider passing a reference to the return object and modifying its values. For example, this code snippet A small amount of something. In the computer field, it often refers to a small piece of program code.  ... ... creates and destroys a new instance OfMyObject every
int len = record.length;
try {
  for(int i=0; i<len; i++) {
    MyObject obj = new MyObject();
    // do something with obj
  }
} catch(Exception e) {
  e.printStackTrace();
}


time the loop iterates. You can avoid this object churning--continually creating and discarding objects in the memory heap--by moving the object creation outside the loop. A more efficient way to rewrite the code above would be to create the object outside the try statement and reuse that object as follows:
int len = record.length;
MyObject obj = new MyObject();
try {
  for(int i=0; i<len; i++) {
    // do something with obj
  }
} catch(Exception e) {
  e.printStackTrace();
}


By reusing a single object instead of creating many the program uses less memory and the processor doesn't spend as much time collecting garbage.

* Avoid string concatenation. Concatenating objects with the + operator causes object creation and subsequent garbage collection A software routine that searches memory for areas of inactive data and instructions in order to reclaim that space for the general memory pool (the heap). Operating systems may or may not provide this feature. , and thus chews up both memory and processor time. It is more efficient to use StringBuffer.

* Avoid synchronization (1) See synchronous and synchronous transmission.

(2) Ensuring that two sets of data are always the same. See data synchronization.

(3) Keeping time-of-day clocks in two devices set to the same time. See NTP.
. If a method takes longer than a fraction of a second to run, consider placing the call to it in a separate thread.

Development Tools

Developers usually build applications that will be deployed and run on a platform similar to the one on which it was built, tested, and evaluated. Developing wireless applications is more challenging because they will be developed on one platform (such as a Solaris or MS Windows machine) but deployed and run on a totally different platform (such as a cell phone or a PalmOS device).

The development life cycle of a wireless application comprises three steps:

1. Use your favorite development environment and tools to develop the application.

There are many development environments to choose from. My favourite wireless environment is the J2ME Wireless Toolkit. It is the best environment available, with a simple and intuitive user interface that makes it easy to start developing wireless applications. More importantly, it includes several emulators for testing your applications.

2. Test the application using an emulation environment.

Once you have developed the application and it complies nicely, the next step is to test your application. The best place to test your application at this point is an emulator. The J2ME Wireless Toolkit comes with several, including Motorala i85s, PalmOS device, and RIM Blackberry.

3. Download the application to a physical device and test it on a live network.

Once you are happy with the application's performance on one or more emulators, you can download it "Download It" is Clea's debut single. It was released in the UK on September 22, 2003 and missed the top 20 charting at #21. The single had average promotion, being performed in shows like Top of the Pops.  to a real device and test it there. You cannot download wireless applications over the air now, but soon you will be able to, using the Over The Air (OTA (Over The Air) Refers to any wireless system such as AM/FM radio and network television that uses open space as its transmission medium. ) Provisioning protocol. Until then, you have two ways to download an application hosted on a remote server. You can download it through your PC connection to the Internet using the Motorola iDEN Update Software Applicationl JavaLoader or you can download your own local application to the device using the Motorola Java Application A Java program that is run stand alone. The Java Virtual Machine in the client or server is interpreting the instructions. Contrast with Java applet. See servlet.  Loader A program routine that copies a program into memory for execution.  Lite (JAL JAL Jalisco (Mexican state)
JAL Jalapa (Guatemala territorial division)
JAL Jump And Link
JAL Japan Airlines Company, Ltd.
 Lite)

Vendor-Specific Extensions

If you choose to use other development tools, you may find that they support some vendor- specific extensions to the J2ME. Extensions are not inherently bad, because they drive innovation, but you need to understand that you must choose from among three options:

1. Limit yourself to the standard set of APIs defined through the Java Community Process Sun's system for allowing third parties to submit requests for new features to Java. JCP is a formal process that must be adhered to, and fees are involved. In 1999, Sun submitted Java to the ECMA standards body, but withdrew its J2SE specification later in the year.  (JCP See Java Community Process.

JCP - Java Community Process
) to maximize chances that your applications will run as is on devices with Java implementations.

2. Design your application in such a way that, if it is deployed on a device that doesn't support the vendor-specific extensions your application uses, it can still default to the standard set of APIs defined through the JCP. Catching exceptions is a valid way to implement this approach.

3. Make the calculated decision to develop different versions of the same application for different devices. Java makes this strategy easier than if the application was written in C or C++, but it requires you to take a coordinated approach to minimize the time spent tuning the application for different devices.

Comment:

Mobile devices are already available, and all the necessary components and infrastructure are in place to begin developing and deploying wireless applications. This article discussed the important issues of the wireless environment you must consider when developing applications for mobile wireless devices with limited resources. It also offered hints and guidelines for dealing with the constraints imposed by the wireless environment. In order to succeed in the wireless market, you need to develop relationships with other developers, device manufacturers, content developers, and wireless carriers. You must be prepared to take risks, but remember that the future is bright for wireless software developers, as the emphasis on Wireless Internet opportunities will continue to grow.

www.http://wireless.java.sun.com
COPYRIGHT 2003 A.P. Publications Ltd.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2003, Gale Group. All rights reserved. Gale Group is a Thomson Corporation Company.

 Reader Opinion

Title:

Comment:



 

Article Details
Printer friendly Cite/link Email Feedback
Author:Lorain, Nicholas
Publication:Database and Network Journal
Geographic Code:1USA
Date:Apr 1, 2003
Words:2411
Previous Article:Avril Lavigne worm needn't be so complicated- sophos. (Virus Reports).(Brief Article)
Next Article:Honeypots: the trap is set. (Database And Network Intelligence).
Topics:



Related Articles
E-BUSINESSES SEEK CONFIGURATIONS FOR RANGE OF CLIENT DEVICES.(Technology Information)
THOMSON FINANCIAL FORMS ALLIANCE WITH ABI.(Company Business and Marketing)
Inet Releases GeoProbe and GeoProbe Mobile Version 5.
Database and Network Journal editorial features 2001.
RDM SERVER BENEFITS FROM BUSINESS INTELLIGENCE SOFTWARE.(Birdstep Technology contract with Cognos Inc.)
Cognos licenses database drivers from DataDirect Technologies.
Interactive Intelligence integrates with Microsoft CRM. (Strategic Alliances).
U.S. government still mining data.(News, Trends & Analysis)
MySQL V5--ready for prime time business intelligence.(DATABASE AND NETWORK INTELLIGENCE: White Paper)

Terms of use | Copyright © 2010 Farlex, Inc. | Feedback | For webmasters | Submit articles