Ich versuche xml von URL mit jdom-2.0.6.jar zu analysieren, aber ich bekomme IOException:Android JDOM2 XML-Parsing, IOExcetion
IOException: Couldn't open "here is xml link"
Das, was ich tue:
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
String myurl = "https://myfile.xml";
SAXBuilder builder = new SAXBuilder();
try {
Document document = builder.build(myurl);
Element rootNode = document.getRootElement().getChild("myroot");
} catch (IOException io) {
Log.d("IOException", io.getMessage());
} catch (JDOMException jdomex) {
Log.d("JDOMException", jdomex.getMessage());
}
Derselbe Code funktioniert gut in Eclipse, aber nicht in Android Studio. Also was ist los?
Es druckt das gleiche, keine weiteren Informationen. – viderSelf