09-11-2008 02:52 PM
I've got a browserfield that I can load from faked http connections using local data. I have a thread that downloads
various piece of html and keeps then cached in anticipation of later need. While I could create a new renderingsession
and renderingapplication to go get all required resources, I thought it would be quicker to simply parse the
html and extract the required stuff. Is there an easy way to do that on the phone? I guess I could create a page on a server
to handle the request and create some server side logic to feed me the url's but it seems it would be possible to do on the
phone and I have XML/SOAP/RSS applications contemplated that I would like to integrate using a similar concept.
09-15-2008 11:26 AM
There are no APIs in the BlackBerry API set that apply specifically to HTML parsing, but there are XML parsers.
You can also open the browser with raw HTML. The following link explains how this can be done.
How To - Invoke the browser with raw HTML
09-15-2008 12:28 PM
Thanks but that html doesn't help because I want this to work on 4.x and want to just go cache all the
images during dead time for rendering later.
I'll see what I can do either with XML or bruteforce code.
09-15-2008 12:37 PM
I've found from experience that this sort of problem is a good fit for a very very simple "look-for-the <tagname characters" type parser. Anything else is going to incur the cost of DOM creation, or all the extra nodes that you don't care about, etc.
Not much of an answer, I know, but that's what I always end up doing.
09-15-2008 02:46 PM