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

In this chapter, we extend FtpView to allow the user to look up hosts by name or address and services by name. We extend our library of wrapper functions around the Net Library API to provide hostname, address, and service resolution. First, let’s look at the changes to the program from the user’s perspective.

Application Startup

When the application starts, it initializes the Net Library. The results of this initialization are displayed on the screen, as shown in Figure 7-5.

Initial screen of sample application

Figure 7-5. Initial screen of sample application

This screen is similar to the initial screen in the previous version. The Open and Close buttons have been deleted, replaced with three new buttons: Name, Address, and Service. These buttons allow you to look up hosts, address, and services by name, respectively.

Name Lookup

When you select the “Name” button, the application displays a dialog that allows you to enter a hostname as shown in Figure 7-6.

Name lookup dialog

Figure 7-6. Name lookup dialog

Enter the hostname and select “OK.” The application then attempts to look up the host information associated with that name.

The application does not connect to the network until a network request is made. Hostname resolution is a network request. If the user is not yet connected to the network, the application warns ...

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