quill wrote:
> I think that the open-source html-parsers in java-source.net should do
> some fixes in order to run on android. Is there any version for
> android?

You would have to ask them. I have not tried parsing HTML on-device.

> And I find that android sdk provides android.text.Html.fromHtml(String
> source) to parse html data to a Spanned type text. But I wonder if
> there is any flag in this Spanned type text for me to get the
> information which I want(the sdk document seems not so clearly for
> me).
> For example, if I want to get the title, should I use Spanned.getSpanns
> (getSpanStart("title"),getSpanEnd("title"), type)? There is a title
> tag in html, but getSpanStart("title") return -1.

You may wish to use Google Code Search to find the source to fromHtml().
My guess is that it focuses on a small range of tags typically found
inside the <body> tag (e.g., <b>, <i>), and <title> is not one of those.

Depending on what you are trying to build, you might consider whether
you should be creating a Web service that does this sort of processing
for you, rather than try to do it on the device.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to