Before we get down to installing AppForge, let’s review the versions of the product. First of all, AppForge supports multiple handheld platforms: the Palm Computing Platform and the Microsoft Pocket PC. In this book, we are only going to cover AppForge for the Palm OS. AppForge for the Palm comes in two flavors: Personal and Professional. We’ll look at what comes with each edition, and how each is different.
Both editions ship with the
AppForge Visual
Basic add-in, which is the compiler.[1] Like Microsoft VB, compiled AppForge
programs on the Palm require a runtime component to
function—the Booster. This is the equivalent of
Msvbvm60.dll
, the Microsoft VB Runtime. The
Booster
for Palm OS is freely available for
download and redistribution from the AppForge Web site.[2]
There are costs and benefits associated with the use of the AppForge Booster:
- Execution speed
Calling into another layer of code can impact performance. The performance penalty on a Windows machine is trivial, but it can be significant on the low-powered Palm PDA.
- Code size
The Booster is large—more than 350 KB of memory. Even though 8 MB of memory is more common now, this is still a big amount.
- Shared code
If more than one AppForge application is installed on the Palm PDA, then there is an advantage to using the Booster, because library and common code is not duplicated between applications.
- Maintenance
Bug fixes to the common functions in the Booster need only be distributed once to patch all AppForge applications on a Palm PDA.
The AppForge Booster consists of three core
components that provide basic services analogous to the Microsoft
Component Object Model (COM): pCOM.prc
,
AFCore.prc
, and
ByteStream.prc
. These components must be
installed on the Palm device in order to run any AppForge
application. In addition, AppForge libraries and services are
implemented in separate components; these are only necessary if your
application uses their functionality. AppForge provides
a detailed explanation of the
components in the Booster in their Knowledge Base, available at
http://www.appforge.com; see article number
010926-0000039.
Each edition of AppForge ships
with a set of ingots.
Ingots are like the ActiveX
controls that you
normally would drop on VB forms. AppForge includes a basic set of
ingots that provide the functions of the VB intrinsic controls and
some advanced ingots for other features.
Tip
You cannot use the VB intrinsic controls on the Palm, nor can you use third-party ActiveX controls. The AppForge add-in will issue an error if you try to reference one of these controls in the VB editor.
Each edition includes a set of libraries that provide extra functionality to an application on the Palm PDA. These libraries offer functions similar to the Microsoft Win32 API, such as the ability to access databases or call other applications
Each edition also ships with a set of tools to help automate software development tasks outside of the VB IDE. One tool generates Palm database (PDB) files from a Microsoft Access database. This is useful because the Palm doesn’t have a traditional filesystem—all persistent data for an application must be stored in a PDB file. Also included with some editions are programs that convert images and True Type fonts to AppForge’s native format.
As we said earlier, ingots are the AppForge equivalent of the VB intrinsic controls. In fact, ingots have a dual existence. When in the VB IDE, they are ActiveX controls, just like any other control in the toolbox. When running on the Palm, however, they are part of the Booster runtime.
When used in an application, ingots support most—but not all—of the properties of the Microsoft intrinsic controls. This makes a great deal of sense, as many of the graphical features of Windows do not exist on the Palm. And of course, there is a runtime penalty for supporting extra features that are simply too much overhead for the Palm PDA and its tiny CPU. We won’t cover every unsupported or changed property in this book, but we will point out the important differences between Windows and the Palm.
For example, the command button on Windows supports several properties that govern how the button appears when it is pushed, disabled, or transparent. These properties are not supported in the corresponding AppForge ingot—they have no meaning on the Palm, and their sudden appearance in an application would be disconcerting to the user. And don’t even think about drag and drop technology.
Overall, AppForge has struck a reasonable balance between supporting the native Palm interface style and providing the extra functionality that VB developers are used to having. Note that the different ingots are implemented by different components of the AppForge Booster. We present them in the following sections, grouped by Booster component.[3]
The following ingots are
implemented in
BasicIngots.prc
.
- Form
- AFButton
This is a Palm-style command button, flat with rounded corners. There is no cancel or default property.
- AFCheckbox
This is a Palm-style checkbox, flat with an extended check mark.
- AFComboBox
This is a multimode
Combo
box. One mode supports the native Palm style, and two others support a more Windows-like appearance and behavior.- AFLabel
- AFListBox
This is like the VB
ListBox
control. This control is used sparingly on the Palm because it is so space-intensive.- AFRadioButton
- AFShape
This is like the VB
Shape
control. This is a useful ingot, because there is no support for the VBLine
orFrame
controls.- AFTextBox
This is a Palm-style text box, complete with dotted lines in multiline mode.
- AFTimer
This is a standard timer. Like the VB timer, it measures intervals in milliseconds.
These ingots are
implemented
in EnhancedIngots.prc
.
- AFGraphic
This is similar to the VB
Image
or VBPictureBox
, which have no corresponding Palm interface element. There is no control container support.- AFGraphicButton
This is a graphical style command button that allows an image to be used instead of a textual caption. The button supports different states, such as disabled or down.
- AFGrid
This is like the MS
Grid
control, which is similar in function, but not in appearance, to the Palm table interface element. There is no data binding support for this or any other AppForge control.- AFHScrollBar
This ingot implements a horizontal scroll bar. Professional only.
- AFSlider
This ingot provides a Palm-style slider control. Professional only.
- AFVScrollBar
This ingot implements a vertical scroll bar. Professional only.
The following ingots are
implemented
in DataCommIngots.prc
.
- AFClientSocket
This ingot is used to perform socket-based communications over a wireless or network connection. Professional only.
- AFInetHTTP
This ingot provides access to the native wireless Internet library on radio-enabled Palm devices (InetLib). Professional only.
- AFScanner
This is a special-purpose ingot for accessing the barcode hardware on the Symbol SPT1500 and 1700, as well as plug-in Springboard scanner modules for the Visor. Professional only.
- AFSerial
This ingot accesses the serial and infrared ports on the Palm device. It is similar to the VB
Comm
control.- AFSignatureCapture
This ingot is used to record user handwritten signatures via the stylus. Professional only.
The AppForge libraries also have a dual existence. When in the VB IDE, they are ActiveX servers, and all their features are available from the Object Browser. When running on the Palm, they are part of the Booster runtime. Because these libraries are integrated into the AppForge Booster, a new release of the Booster must be installed on the Palm PDA whenever AppForge adds or changes libraries. Of course, this is only true if your application needs to access those new features.
Here are the basic libraries that ship with all editions of AppForge
(all implemented in afExtLib.prc
):
- PDB library
This library provides functions that wrap the Palm OS database manager. This includes a schema capability that simplifies reading and writing fielded data records.
- Numeric library
- System library
This library includes miscellaneous functions, such as the Palm username. It also provides a way to access extended keycodes on the Palm PDA.
- Extended functions library
This library provides a raft of functions for accessing or changing settings on the Palm PDA. This includes features like the Graffiti handwriting state and a listing of all the databases.
If you are new to Palm software development, it might surprise you to learn that inter-process communication is quite difficult on the Palm. This is because the Palm was designed as a single-tasking computer—the user is generally focused on one program, not sharing data between multiple windows.
The operating system doesn’t provide direct support for dynamic data exchange or object linking. Instead, you invoke a Palm application as a sub-routine call, with a special launch code.[4] AppForge provides a library to support this capability:
You can also use this library to call functions in the Palm operating
system. AppForge has a sample application,
Fuser
, which demonstrates this capability.
We’ll look at the extensibility library in depth in
Chapter 8. This library is implemented in
afPalmOS.prc
.
AppForge provides a raft of utility programs to support application development. Many of the software aids that VB developers take for granted do not exist yet for the Palm. These AppForge utilities fill voids in the range of available software tools.
For example, there is no Active Data Object
support on the Palm, so all record and database access must be coded
by hand. This is similar to programming directly to the ODBC function
specification. The AppForge Database
Converter, however, not only converts an Access table to native Palm
format, it also generates VB source code to read and write records in
the converted database.[5] This is not quite
object-oriented, but it is much better than rolling your own ADO or
OLE-DB layer.
The following basic utilities ship with all editions of AppForge:
As with the libraries, AppForge provides some special-purpose utilities available only with the Professional Edition of the product:
- Font Converter and Viewer
This utility converts True Type fonts to the AppForge format. Converted fonts can be used with any ingots that have a Font property. Professional only.
- Movie Converter and Viewer
This utility converts AVI movie formats to the AppForge format. Converted movie files can be used with the Movie ingot. Professional only.
- Universal Conduit
This utility interfaces Palm databases to any ODBC-compliant data source, using the standard Palm HotSync technology. Professional only.
A conduit is software that replicates or synchronizes databases on the Palm with personal or corporate data on the desktop. As you will see in Chapter 4, developing a conduit is a significant amount of work. If your application data is in a relational or tabular format and doesn’t require a lot of special-case processing, then the Universal Conduit can save a lot of effort. We address the Universal Conduit in Chapter 5.
[1] Since the
AppForge compiler runs on Windows, it is actually a
cross-compiler
—a program that produces
executable code for a different runtime platform. This executable
code can be targeted at either the Palm OS or the Pocket PC
environments.
[2] The Booster for other platforms has a runtime fee, although you can download evaluation copies for development at no charge.
[3] When deploying your applications, you will only want to install those Booster components truly necessary to run, so that you can conserve memory on the Palm device.
[4] Unfortunately, few applications publish their database formats or launch codes, so accessing other programs usually involves a reverse-engineering effort, or poring through the source code if it’s available.
[5] It is important to note that the Database Converter only works with a single table at a time; you have to run the converter multiple times to process all the tables in an Access MDB file.
Get Programming Visual Basic for the Palm OS now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.