Palm Programming: GPS receiver

A detailed Summary of Palm Programming: GPS receiver


This paper looks at the process of developing an application for a device running a Palm operating system; specifically, any device running OS 3.x or newer. The main focus is broken into two separate ideas: understanding the process flow and minimum requirements of any Palm application and the development of a program to receive and display data gathered from a Garmin GPS 25 LVC receiver unit. All of the programs, processes, and ideas contained herein are based on the use of CodeWarrior, a developer's environment for the PC available as freeware from Metrowerks Corporation.

As with any programming environment, the programmer must first learn the basics of how the computer functions. Most programmers are familiar with the PC environment and standard flow of an application. When programming in any language on a PC, the developer must create and include any functions or additional files that are necessary for use with the application being created. However, the Palm OS is slightly different, and rightfully so considering the limited storage capacity available on most handhelds. When a Palm application is being developed, many of the functions that are going to be needed for performing the most comm


As mentioned before, there are several points in the code that user created functions can be called depending on the particular application. The GPS program requires that the serial port be continually searched for new data on some specific increment of time. By placing this function in the event loop of the program and using the EvtGetEvent function, the port can be checked on any increment of time. The arguments for EvtGetEvent are a pointer to the next event and a timeout value. If the user does not create another event before the timeout, the display will be updated after each timeout. If the user does create another event, the display is updated immediately and then the event is handled. A one second timeout period was chosen to verify that the data is continually accurate.

To keep the user better informed of what actions the application is performing, a series of alerts and information boxes was created. The first of these was a label that appears when the program is first started which says "Searching for GPS...". This label lets the user know that the program has begun to search the serial port for the RS-232 standard data stream that is expected to come from the GPS device. After this, two more labels needed created that would appear when the program was done searching and had either found the expected data or not. Rather than creating these as static labels like the others, these were created as string constants because they will be used to replace the existing string. When the program is running and the search for data is complete, the original search label is erased and one of the strings are called and inserted in its place. This keeps the program smaller by not having to create the necessary resources and memory needed for adding more labels to the main form.

To begin developing an application, the programmer must first choose a suitable programming language and a compatible compiler/debugger. Metrowerks has an easy to use developing environment called CodeWarrior. CodeWarrior has a wizard that is available for use with Palm OS. After obtaining this and a SDK from Palm, the programmer must learn the structure of a project.

For the GPS program, information messages were created for when the serial port was opened and closed. Error messages were created for when the serial port was already in use, when the serial port could not be opened, and when the operating system version was not compatible with the application. When any information box is displayed, no other actions can be performed in the application until the OK box is selected and the pop-up is closed. If the pop-up is an error, it is the programmer's responsibility to stop the application.

The next function must load the main form on the screen. A form is a visual interface that is displayed and may contain additional user interface elements. There may be multiple forms in a given application but there must be at least one. This main form acts as the backdrop for all of the actions that will occur in the program. Certain user interface elements may be programmed to open a different form which may either be written over the main form or the main form can be erased first if the secondary form would not completely overwrite all of the elements of the first. User items such as buttons, menus, scroll bars, input and output boxes, etc. are each anchored to a specific form and are only visible and active when that particular for is displayed on the screen.

The next major portion of PilotMain is the EventLoop or sometimes called the AppEventLoop. This function must be contained in every Palm program for the program to function. All programs are event driven; that is, the majority of the time the program sits in this event loop waiting for the next command. Any event that occurs on the device such as placing the pen down or up, selecting a menu, pressing a button, etc. causes an even to be placed in the event queue. E

Some common words found in the essay are:
Function ReadSerial, Searching GPS, Project Structure, Constructor Figure, PilotMain EventLoop, GPS Program, Finishing Application, Palm OS, PilotMain RomVersionCompatible, Palm C/C++, serial port, event loop, main form, user interface, source code, gps program, source file, resource file, figure 1, called pilotmain, user interface elements, created serial port, messages created serial, file resource file, static labels created,

Approximate Word count = 2997
Approximate Pages = 12 (250 words per page double spaced)

join now Save Paper



Saved Paper

Save your papers so you can locate them quickly!

Newest Essays

Testimonials

  • "Thank You So Much!!! You have saved me once again!!!"
    Jack M.
  • "With so many papers to chose from, I was able to get ideas to help me with all of my classes. Thank You!"
    Brian P.
  • "I've used this site for the last 3 years to help me come up with ideas for my papers."
    Sara J.
  • "I use this site every week to help me write my own papers!"
    Rachel W.
  • "I love this site!!!"
    Marie N.