Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Introduction to GPS, Part 3

After his college basketball career came to an end without a multiyear contract to play for the L.A. Lakers, Frank Ableson shifted his focus to computer software design. He enjoys solving complex problems, particularly in the areas of communications and hardware interfacing. When not working, he can be found spending time with his wife Nikki and their children. You can reach Frank at frank@cfgsolutions.com.

Summary:  This tutorial is designed for developers and product managers considering the Java programming language as an option for use in Global Positioning System applications. Developers with an interest in creating Java applications for PDA and embedded environments learn the basics of embedded Java development in resource-limited environments, including available tools and Virtual Machine options. The broader topic of small-scale Java capabilities, limitations, and packaging options offers valuable market perspective for product managers.

Date:  17 Sep 2002
Level:  Introductory PDF:  A4 and Letter (362 KB | 26 pages)Get Adobe® Reader®

Activity:  2211 views
Comments:  

Introduction

Should I take this tutorial?

This tutorial is designed for developers and product managers considering the Java programming language as an option for use in Global Positioning System (GPS) applications. Developers with an interest in creating Java applications for PDA and embedded environments learn the challenges of embedded Java development in resource-limited environments, including available tools and virtual machine options. The broader topic of small-scale Java capabilities, limitations, and packaging options offers valuable market perspective for product managers.

This is the third tutorial in a three-part series on developing GPS applications with Java technology. It's recommended that you read through the first two tutorials, Introduction to GPS, Part 1 and Introduction to GPS, Part 2, where fundamental GPS principles are introduced and discussed. The prerequisite tutorials demonstrate basic Java programming skills necessary for handling GPS data. The sample applications presented in this tutorial focus on porting these GPS applications to a Java PDA environment.


What is this tutorial about?

This tutorial examines the options, obstacles, and opportunities associated with Java-based GPS applications on portable devices such as PDAs and cell phones. This tutorial explores two basic programming models for portable GPS applications and examines the tools and environments required to build them. The first variety of application deviates slightly from the theme of the prior tutorials as it is characterized by the lack of a local GPS receiver unit. This application variant examines informational applications, focused on the use of GPS data, rather than the collection of it. The second variety of application explores the Java programming options available for the Palm OS-based GPS applications. Consistent with the experiences from the first two tutorials in this series, communicating with a GPS receiver via the Java programming language has its challenges. Various development options are examined during the construction of a Palm OS-based Java application that extracts GPS data directly from a Garmin unit via a serial connection. The tutorial consists of the following sections:

  • Global positioning applications : This section discusses two models of GPS applications including those that make use of GPS data versus those that collect GPS data.
  • The "Write once, run anywhere" promise : Java technology has proven itself in the application server environment and the browser client. This section explores the question of whether Java technology has lived up to the hype and promise in the wireless device market.
  • Java programming environments : This section offers a brief survey of the development tools and environments available to Java developers. This section also revisits the I/O requirements of data collection devices and the options available in the Java environment.
  • Sample Application: MIDlet : This section details the creation of a MIDlet application, suitable for a cell phone or PDA, using the WebSphere Studio Device Developer environment. It demonstrates an HTTP connection for the purpose of using GPS data in a wireless application setting. The basis of the application rests upon a data retrieval model, supported by a remote Web/application server infrastructure.
  • Sample application: Java in the Palm OS : This section examines a Java Palm OS application utilizing the SuperWaba environment. The choice of this particular environment is due to its ability to "hide" the Palm OS specifics into a simple-to-follow Java application.

Source code roadmap

This tutorial's sample applications demonstrate a variety of Java- and GPS-related techniques. Examples of a simplistic MIDlet user interface, HTTP connections, serial connections, and Java/Palm OS user interface invocations are present. The following code snippets are found in this tutorial:

  • The imports of a MIDlet, including the appropriate packages for network connectivity required for the sample application's GPS lookup function, are examined.
  • User interface elements of the MIDlet are explained.
  • The commandAction method, which handles events initiated by the user of the MIDlet, is presented and explained.
  • An HTTP network connection is initiated and processed when the "Go" button is pressed in the MIDlet.
  • The configuration of Mobile Creator is important to the successful building of the second sample application. A screenshot depicts the settings used to construct the sample application.
  • The Mobile Creator build process is presented, including all of the steps that Mobile Creator hides from the SuperWaba developer, making the experience of getting started that much more palatable.
  • The user interface elements of the SuperWaba application are presented and explained.
  • The AddString method, which is the primary means of user feedback in the ibmdwgpspalm application, is examined.
  • The onEvent method, which reacts to user input and drives the core functionality of the application, is presented.
  • The ProcessPort method, which handles incoming data from the GPS unit, is examined.

Some helpful terms

  • Byte stream: Data sent from one device to another can be characterized as a stream of individual bytes.
  • DataInputStream: An implementation of the DataInput interface and an extension of the InputStream class. The unique characteristic of the DataInputStream is its ability to read Java native data types directly from a stream.
  • Query: A very generic term used to represent a request or question originating from a "client" application and responded to or answered by a server or service.
  • HTTP: Hypertext Transport Protocol
  • eCOS: The embedded Configurable Operating System, an open-source, real-time operating system managed by RedHat, the distributor of a popular release of Linux.
  • Eclipse: A comprehensive, open-source development environment.
  • J2ME: Java 2 Micro Edition

Tools

This tutorial introduces a variety of software tools as viable alternatives for embedded Java development in an effort to effectively paint the landscape of tool offerings. Although there are many available Java development environments to choose from, the tools chosen for use in this tutorial are the Websphere Studio Device Developer, based on the Open Source Eclipse environment, and SuperWaba in conjunction with Mobile Creator. Eclipse itself encompasses many technologies and is a project unto itself. For the purposes of this tutorial, it is presented as a useful tool for managing various build targets -- a unique aspect of wireless cross-platform development. Mobile Creator and SuperWaba combine to be (arguably) the easiest Java development environment for the Palm OS.

  • Websphere Studio Device Developer: This toolset, downloadable in evaluation form at http://www.embedded.oti.com/wdd/, is the development environment and toolset for the first sample application presented in this tutorial.
  • SuperWaba: This development environment, toolset, and virtual machine are among the most popular Palm OS and WinCE Java development resources. SuperWaba is employed for the second sample application and can be downloaded at http://www.superwaba.org.
  • Mobile Creator: This simple IDE simplifies SuperWaba development for the intermediate embedded Java developer. With a few entries in the preferences panel, the developer need not venture into the world of "DOS Prompt" commands and batch files for compilation. Mobile Creator is employed for the second sample application and can be downloaded at http://www.tauschke.com/main.htm.
  • The Java Development Kit: This tool is the underlying compilation mechanism for the second sample application and can be downloaded at http://java.sun.com.
  • Palm OS Emulator: The tutorial's sample applications are most conveniently tested on the Palm OS emulator available for download from http://www.palmos.com/dev/tools/emulator/.
  • GPS Unit: The tutorial's second sample application demonstrates communications with a consumer GPS unit capable of the NMEA data protocol. For more information on the NMEA protocol, please refer to the Introduction to GPS, Part 1 tutorial here on developerWorks.
  • Tutorial Sample Code: The complete code to the tutorial's sample applications can be found at: http://www.palm-communications.com/ibmdw.

1 of 9 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=136701
TutorialTitle=Introduction to GPS, Part 3
publish-date=09172002
author1-email=
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).