elegos, The official dev guide provides an example for XmlPullParser: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
Bear in mind XmlPullParser has some specific uses. If you are looking for an alternative to SimpleXML then you should probably look at basic SAX parsing, as you are unlikely to be interested in the entire XML document. Perhaps start by taking a look at this tutorial: http://www.helloandroid.com/node/110?page=0%2C2 Some of your comments suggest that your knowledge of Java is probably not as strong as it probably needs to be. I suggest you run through some Java tutorials to get a feel for the fundamentals before wading much further into Android development, in particular the topic of checked exceptions: http://www.tutorialhero.com/tutorial-71-java_exceptions.php Regards, Sean On Sun, Jul 26, 2009 at 4:57 PM, elegos<[email protected]> wrote: > > Mark please that was only a part of the message. Thank you for the > explanation, but can you explain me XML Pull Parser, the line I asked > for, and maybe a link or two where to find simple examples on how to > start using it, or to start parsing XML? > I wouldn't ask in this group if I only wanted to cry on my own > shoulders because of the java system. > > Thanks > > On 26 Lug, 14:24, Mark Murphy <[email protected]> wrote: >> elegos wrote: >> > I'm new to the Java programming (see the other messages), I come from >> > PHP for handling XML files. I usually use SimpleXML, a very simple >> > class to manage this type of files. Here is an example: >> >> > $xml = new simplexml_load("http://mycoolsite.com/file.xml"); >> > foreach($xml->contents as $entity => $value) >> > echo "$entity: $value"; >> >> > Ok, now tell me why I should handle XML files like THIS: >> >http://www.anddev.org/parsing_xml_from_the_net_-_using_the_saxparser-... >> >> 1. Because it is part of standard Java. >> >> 2. Because you are no longer writing PHP to run on a 2009 Web server, >> with quad-core-plus processors and multiple GB of RAM; rather, you are >> writing Java for a phone whose hardware specifications most closely >> resemble a Web server from 1996. Having owned and operated a Web server >> in 1996, I speak from personal experience... >> >> Parsing an XML file fully into RAM can be done (using the DOM parser), >> but it is expensive in terms of CPU time and RAM, neither of which exist >> in abundance on a phone. The better-performing solutions, SAX and XPP, >> are event-based, meaning you only hold onto in RAM the bits and pieces >> you actually need, and Java can accelerate past chunks of the file that >> you do not need. >> >> Of the three (DOM, SAX, XPP), XPP is probably the least used, since it >> is not part of standard Java, though it is available in the Android SDK >> via a third-party library. Hence, the other two will be more widely >> documented, with samples and tutorials and books and whatnot. >> >> -- >> Mark Murphy (a Commons >> Guy)http://commonsware.com|http://twitter.com/commonsguy >> >> Android Training in Germany, 18-22 January 2010:http://bignerdranch.com > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

