How to Parse XML Documents (Android)
- Install the latest android sdk
- Create an Android project
- Create classes called DownloadXMLAsyncTask.java and IDataChangedListener.java using the code from here in your Android Project.
- Modify the MainActivity for Andriod, similar to what you did for the iPhone here, but using the new DownloadXMLAsyncTask.java as a starting point
- You will need the following permission to your manifest file: <uses-permission android:name="android.permission.INTERNET" />
Here is come code to help initialize your parser
HttpURLConnection connection;
URL xmlUrl = new URL("http://www.w3schools.com/xml/cd_catalog.xml");
XmlPullParser receivedDataParser = XmlPullParserFactory.newInstance().newPullParser();
connection = (HttpURLConnection)xmlUrl.openConnection();
receivedDataParser.setInput(connection.getInputStream(), null);