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 ...

Get Palm OS Network Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.