The sample application (
of the steps in connecting to and disconnecting from the network. It
also highlights the resources consumed as the process goes through
each step. As an end user application, it lacks a certain appeal; one
might even say it’s useless. But it clearly illustrates the
issues involved in initializing, opening, and closing the Net
Library. It is the first step on the road to becoming a Palm
The main things you must do in every Palm OS network application you write are:
Make sure the Net Library is installed and that your application is compatible with it by retrieving its version number.
Obtain a reference to the Net Library from the operating system by
Open the Net Library by calling
sure to check for errors both in the return value and in the
interface error parameter. If the library is already open or an
interface error is returned, check the state of the interface you are
interested in to make sure it is loaded.
When you are finished with the network, call
NetLibClose. Unless you have a really compelling
reason for closing your connection immediately, you should specify a
Of course, there’s still a fair amount of work to do between steps three and four: connecting to the network, establishing connections with remote hosts, and exchanging data. We cover these topics in depth in Chapter 7 through Chapter 12.
When the application ...