On Feb 7, 9:59 am, CMF <manf...@gmail.com> wrote: > Hi guys~:) > I would like to parse the strings.xml > Here is my code: > > Line1: DocumentBuilderFactory factory = > DocumentBuilderFactory.newInstance(); > Line2: DocumentBuilder builder = factory.newDocumentBuilder(); > Line3: Document dom = builder.parse(new File("//myproject//res// > values//strings.xml")); > Line4: Element root = dom.getDocumentElement(); > Line5: NodeList items = root.getElementsByTagName("String");
This is going to work with raw resources only ( like this ): final InputStream inputStream = getResources().openRawResource(R.raw.help); Other resources are precompiled in something looking as dbase file (fo me and my debian) I could reat them through classloader, but it was not xml. > However, in line3, I don't know what the actual path of the > strings.xml is, could any one can tell me? > Besides, I found another method to work with XML, but I don't know > what the id should be... > XmlPullParser parser = getResources().getXml(id); Id shall be from your R.<something>.id -- 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