0

the kxml2 package is in the j2objc source tree (1.3.1) enter link description here

but I cannot find the kxml2 supported after compile j2objc. Studied from a forum explanation enter link description here, seems like these classes aren't part of the public JRE or Android API. Therefore j2objc will not support it. Is there anyway to add these package manually?

SamTT
  • 19
  • 6

1 Answers1

0

The kxml2 package implements the javax.xml.parsers and org.xml.pull.v1 factory interfaces. These are the public API your app should use for any XML parsing. You can find examples for how to access and use these factories in j2objc's test classes, as well as from a general internet search.

tball
  • 1,984
  • 11
  • 21
  • 1
    Thanks tball! I'd like to use j2objc to compile mapsforge https://github.com/mapsforge/mapsforge which use kxml2 package. When I use j2objc to compile mapsforge, it shows up 'org/kxml2/io/KXmlParser.h' file not found. Therefore, I would like to add this package into j2objc manually. – SamTT Feb 05 '17 at 23:33
  • If you [build j2objc from source](http://j2objc.org/docs/Building-J2ObjC.html), all JRE headers (public and private) are in j2objc/jre_emul/build_result/Classes/. Since Objective C doesn't have a notion of private classes, you're free to reference internal classes now that you have the headers. You just can't complain if Android changes what XMLPull implementation it uses, and kxml2 therefore disappears from j2objc (well, you can complain, but you'll be ignored on the j2objc-discuss alias :-). – tball Feb 07 '17 at 00:15