O'Reilly logo

Palm OS Network Programming by Greg Winton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sample Application

The sample application (FtpView) demonstrates each 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 networking guru.

The main things you must do in every Palm OS network application you write are:

  1. Make sure the Net Library is installed and that your application is compatible with it by retrieving its version number.

  2. Obtain a reference to the Net Library from the operating system by calling SysLibFind.

  3. Open the Net Library by calling NetLibOpen. Be 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 delayed closing.

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.

Application Startup

When the application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required