Is this a web page that already exists that you didn't create. If so, then you will have to write code that parses the HTML and get the data you would like.
Or you can create your own Servlet, that your MIDlet calls, in which the Servlet does the call to the outside Web Page, and parses it on behalf of the MIDlet, and just send back the needed text to the MIDlet.
Otherwise, I would suggest creating a seperate Servlet for you to call that will only pass back the specific text that you want. Or if you don't have Servlets, then create a new "html" page that will just be text that sends back the information that you want.
yes, i want to create a servelt which can read the data from the html page and hand it over to the midlet.. but how???
Alfredo Estrada
Greenhorn
Joined: Jan 07, 2006
Posts: 4
posted
0
Dear saikrishna cinux:
the way to read "bytes" a URL connection is next pseudocode:
1- Connect to URL 2- Open InputStream 3- Read bytes and store into ByteArrayOutputStream 4- Close the InputStream 5- Get the byte[] from the ByteArrayOutputStream, and process ! 6- Notify to other Main Class( like work as Listener) (e.g. using static boolean flags) that the connection has done.
*7 If any error ocurrs, must do some like step 6. but specifing the reason of error.
these steps shuld be in a separated Thread, the body of run method.
Casper Maxwell
Ranch Hand
Joined: Aug 04, 2005
Posts: 88
posted
0
You may use following code as a starting point too: