I have my parser set up to parse the xml and the only thing I can't
figure out how to do is to make a https connection in Android to get
the xml from.
My onCreate method is as follows:
public void onCreate(Bundle icicle) {
String string = "";
super.onCreate(icicle);
TextView tv = new TextView(this);
try {
URL url = new URL("https://example.com/example.xml");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
AIHandler myAIHandler = new AIHandler();
xr.setContentHandler(myAIHandler);
xr.parse(new InputSource(url.openStream()));
ParsedAI parsedAI = myAIHandler.getParsedData();
string = parsedAI.getAcademicInfo();
} catch (Exception e) {
/* Display any Error to the GUI. */
Log.e("TAG", "ERROR", e);
}
/* Display the TextView. */
tv.setText(string);
setContentView(tv);
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---