Android + Nekohtml – the Naive approach

Nekohtml zip includes a JAR file.

Naive approach:

Add the JAR to the build path, and hope for the best.

How:

  1. Quite simple, create a lib directory under the project, copy the JAR file.
  2. Add code that access the nekohtml:
DOMParser parser = new DOMParser();

Result:

Failed!

W/dalvikvm(  170): Unable to resolve superclass of Lorg/cyberneko/html/parsers/DOMParser; (115)
W/dalvikvm(  170): Link of class 'Lorg/cyberneko/html/parsers/DOMParser;' failed
W/dalvikvm(  170): VFY: unable to resolve new-instance 196 (Lorg/cyberneko/html/parsers/DOMParser;)

Tags: , , ,

Leave a Reply