No, the file isn't inside my application, it is external, an upgrade! I used XMLPullParser, but in this way i can't parse the file two times.
i.e. XmlPullParser xpp= ctx.getResources().getXml(R.xml.file); XmlDeserializer xmlDeserializer= new XmlDeserializer(xpp); List<BeanA> listOfBeanA= (List<BeanA>)xmlDeserializer.deserialize(BeanA.class); List<BeanB> listOfBeanB= (List<BeanB>)xmlDeserializer.deserialize(BeanB.class); At firts time (BeanA), the parse works correctly, at second time, it doesn't works. Can you suggest me another way? Tnx. On Oct 26, 3:24 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > Premier wrote: > > Hello world, > > i'd like to open a popup into my application and read the selected > > file. > > That file is xml-file, and i want to parse it. > > > Now i'm using context.getAssets().open(fileName); > > but it requires text file and not xml. > > If the file is part of your APK, make it an XML resource. Put it in > res/xml/ in your project and use Resources.getXML() to get an XML Pull > Parser. This is reportedly significantly more efficient than parsing it > yourself. > > Beyond that, there are three XML parsers in Android: DOM, SAX, and the > aforementioned XML pull parser. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 1.3 Published! --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---