| [ directory ] |
|
Internet Access from the Palm DeviceLet's have a look at how a J2ME Palm device application can get access to the Internet. The options for connecting a Palm to the Internet are numerous, and vary a little depending on where you live. The following table summarizes the options. There are three basic options:
If you live in the United States, you have all the above options plus one more:
In this chapter we will look at Options 1 and 2 (direct serial and IR connections, respectively) in step-by-step detail. Using a Direct Serial PC ConnectionTo connect the Palm to the Internet using this method, you will need the following:
Install W32 PPP and set up a new PPP connection over a direct serial connection on the Palm. This is done by selecting System | Preferences, and clicking on the Service | New menu. Name the service "Direct PPP," and select "Direct Serial" as the Connection. There is no need to enter a user name or password. Under Details, select "PPP" as the Connection type, and click OK. Make sure that the baud rate on the PC is the same as the Connection being used on the Palm. When you start W32 PPP, you should see a window similar to that in Figure 7.4. Figure 7.4. Mocha W32 PPP
To make a connection to W32 PPP from the Palm, go to System | Preferences | Network, select "Direct PPP," and click Connect. Then the Palm is ready to start the networking Java application. The "Bytes to Palm" and "Bytes from Palm" fields show the number of bytes flowing to and from the Palm, which is a helpful indication that the connection is being made. Using an IR PC ConnectionTo use the Infrared connection option, you need the following:
First of all, make sure that the IR port on the PC is enabled. This can be configured into the BIOS settings on the PC. If the IR port is enabled, Windows will display an icon in the Control Panel, as shown in Figure 7.5. Figure 7.5. Control Panel with the IR port enabled
Install IrCOMM2k as described in the instructions. Don't forget to disable the IR port for digital image transfer. IrCOMM2k is installed as a Windows service that emulates a COM port; you will be asked to specify which spare COM port to use. Often, COM4 is a spare port, but this depends on your PC's configuration. Configure W32 PPP to use the COM port being emulated by IrCOMM2k. Using a Mobile Phone ConnectionThere are two main methods for connecting to the Internet using a mobile phone. The first is by using a data-enabled phone and connecting the Palm OS to the phone using the Infrared port. A data-enabled phone is one that has a built-in modem. For example, Nokia's current list of "data supported" mobile phones is as follows:
Instructions for setting up the Palm OS and the phone for dialing an ISP and making a connection to an ISP are in the user guide for each of the above phones. They can also be found at http://www.nokia.com. The second method is by using a direct connection cable, such as the GlobalPulse product from TDK. This cable supports a wide variety of phones from Nokia and Ericsson. Refer to http://www.gsm4palm.com for more information. The following example uses a Palm OS with a Nokia 8210 GSM mobile phone. First, set up an IR modem connection in the Palm (Figure 7.6). To do this, tap on the Prefs icon and select the Connection menu. Create a new connection and call it IR Modem. Figure 7.6. Setting up a new connection
Tap OK. Now go to the Network menu item and set up a service that uses the new IR Modem connection. If you are dialing your ISP, enter the user name, password and ISP phone number into the Network screen (Figure 7.7). Figure 7.7. Setting up a new network
Before a connection can be made, the IR port on the Nokia needs to be enabled. To do this, select Menu | Infrared | Select. The Nokia will display a message saying that Infrared reception is enabled. To connect, tap on the Palm's Connect button. The Palm will make a connection through the IR port to the Nokia, and the Nokia will dial the ISP and make a PPP connection. Once the connection is made, network applications can access the Internet. To test the connection, start the HttpNetworking application and get the test page. It should work the same way as all the other connection methods. |
| [ directory ] |
|