I\'m trying to use Flurry Analytics for my program on Android and I\'m having trouble getting the xml file itself from the server.
I\'m getting close because in the
The parse method that takes a string is for a URL format. You need to wrap the String in a StringReader before parsing it. It is even better if you can grab the XML as an InputStream and parse that, something like:
String uri =
"http://api.flurry.com/eventMetrics/Event?apiAccessCode=?????&apiKey=??????&startDate=2011-2-28&endDate=2011-3-1&eventName=Tip%20Calculated";
URL url = new URL(uri);
HttpURLConnection connection =
(HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept", "application/xml");
InputStream xml = connection.getInputStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(xml);