| example.http.HttpTest
HttpTest | public class HttpTest extends MIDlet implements CommandListener,Runnable(Code) | | An example MIDlet to fetch a page using an HttpConnection.
Refer to the startApp, pauseApp, and destroyApp
methods so see how it handles each requested transition.
Note: if you run this inside POSE using a multi-homed PC (with more
than one network connections), POSE doesn't know how to resolve
host names not connected to the first network card. To solve this,
add a line like this in your c:/WINNT/system32/drivers/etc/hosts
file:
XXX.XXX.XXX.XXX www.sun.com
where XXX.XXX.XXX.XXX == IP address
|
Method Summary | |
final static void | DEBUG(String s) Debug output routine. | void | addScreen() Add another screen. | void | chooseScreen() Pick a screen. | public void | commandAction(Command c, Displayable s) | public void | destroyApp(boolean unconditional) Destroy must cleanup everything. | void | mainScreen() Display the main screen. | public void | pauseApp() Pause signals the thread to stop by clearing the thread field. | public void | run() Perform the current command set by the method commandAction. | void | setCommands(Displayable d, boolean islist) Set the funtion to perform based on commands selected. | public void | startApp() Start creates the thread to do the timing. |
HttpTest | public HttpTest()(Code) | | Initialize the MIDlet with a handle to the current display
|
DEBUG | final static void DEBUG(String s)(Code) | | Debug output routine.
Parameters: s - string to be printed. |
addScreen | void addScreen()(Code) | | Add another screen.
|
chooseScreen | void chooseScreen()(Code) | | Pick a screen.
|
commandAction | public void commandAction(Command c, Displayable s)(Code) | | Respond to commands, including exit
Parameters: c - command to perform Parameters: s - Screen displayable object |
destroyApp | public void destroyApp(boolean unconditional)(Code) | | Destroy must cleanup everything. The thread is signaled
to stop and no result is produced.
Parameters: unconditional - Flag to indicate that forced shutdownis requested |
mainScreen | void mainScreen()(Code) | | Display the main screen.
|
pauseApp | public void pauseApp()(Code) | | Pause signals the thread to stop by clearing the thread field.
If stopped before done with the iterations it will
be restarted from scratch later.
|
run | public void run()(Code) | | Perform the current command set by the method commandAction.
|
setCommands | void setCommands(Displayable d, boolean islist)(Code) | | Set the funtion to perform based on commands selected.
Parameters: d - Displayable object Parameters: islist - flag to indicate list processing |
startApp | public void startApp()(Code) | | Start creates the thread to do the timing.
It should return immediately to keep the dispatcher
from hanging.
|
|
|