Androids Pull parser is also good and easy to use. Performance is just below SAX parser, the only thing in favor is that its easier to use. http://www.ibm.com/developerworks/opensource/library/x-android/
On Fri, Mar 25, 2011 at 6:03 PM, Filip Havlicek <havlicek.fi...@gmail.com>wrote: > Hi, > > if you are bound to XML, XmlSAXParser is the fastest way to parse it (that > I know of). > > Best regards, > Filip Havlicek > > 2011/3/24 Sebastien S <schwartz....@gmail.com> > >> Hi, >> I'm developping an application where I had to synchronize my phone >> with the entreprise server. >> The response of the server is a xml file with each record between >> <REC></REC> and I had to receive 19000 record. >> What's the best way to parse it and add it to my content provider? >> >> >> At the moment, I do my connection with the server: >> [...] >> HttpResponse httpResponse; >> httpResponse = client.execute(request); >> HttpEntity entity = httpResponse.getEntity(); >> InputStream instream = entity.getContent(); >> >> And then, I parse the input stream: >> XMLSyncParser xmlSyncParser = new XMLSyncParser(instream, sharedPrefs, >> mContext); >> xmlSyncParser.parse(event); // a xml pull parser implementation >> >> The parser, parse it and when he is at the end of the REC element, he >> add it to the content provider. >> >> >> Is there a better way to do it and a way who's taking less time? >> >> Thank you, >> Sebastien >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en