1

First of all I'd like to mention I am very new to Java programming. This Android project is my first experience with Java. So for one task I need to strip HTML tags from a string. I was thinking about using this answer Remove HTML tags from a String to do this task. In order to do this I need to be able to import javax.swing.text.html.* and javax.swing.text.html.parser.*.

I went to the properties of my project and attempted to add this library to my project. I read that this was included in the rt.jar file which was located at /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar

I was able to use the imports but it seems like it added a million libraries I am not using. Will this negatively effect my application? What is the correct way to add just the one extension?

Community
  • 1
  • 1

1 Answers1

4

You don't. Android doesn't use Swing. You'll need to use Android's API to create your UI and perform text parsing. Consider android.text.Html as a simple way to strip HTML from a string.

EboMike
  • 76,846
  • 14
  • 164
  • 167
  • Right, but I need the javax.swing.text.html packages to strip html tags. –  Nov 19 '10 at 22:57
  • 2
    How about using something that Android has? `android.text.Html` can do a blanket-strip of all tags, `javax.xml.parsers.SAXParser` is a complex parser (which is probably overkill for your purposes). – EboMike Nov 19 '10 at 23:02