I need to save a xml file from sdcard to my android app, in res/values. How can I do this? Can anyone help me?
Asked
Active
Viewed 1,324 times
1
-
1I think you should explain why or what you want to achieve here - I don't think what you are asking is exactly possible. The res/values location only really exists on your development machine and is a more abstracted part of the application after compilation. – Elemental Aug 23 '11 at 09:10
-
I have a xml file on sdcard...can I take the infromation from xml direct from sdcard? – Gabrielle Aug 23 '11 at 09:19
-
you can save your xml file in data/data/packagename/file directory. and I think you cant store xml file in res/values directory. If you want to do that then I will guide you. And clarify what is your intention. – user370305 Aug 23 '11 at 09:23
-
my xml file is saved in mnt/sdcard. Can you guide me? – Gabrielle Aug 23 '11 at 09:27
-
what do you want after save it in res/values dir? will you use it as any resurce file for application? or just want to grab the data from it? – user370305 Aug 23 '11 at 09:29
-
I want to save xml file in res/values directory if it is possible...otherwise, I want to know how can I acces information from the xml stored on sdcard. – Gabrielle Aug 23 '11 at 09:31
-
I saved the content of a link in a xml file on sdcard, and now I want to use this content in app. – Gabrielle Aug 23 '11 at 09:33
2 Answers
2
just use the java file command for your xml file on sdcard.
File file=new File("/mnt/sdcard/example.xml");
and using DOM or SAX parser you can parse the data(information) from it for your application.
Thnx.
EDIT: parsing local xml file using Sax in android, Read XML Resources in Android, using XmlResourceParser: XML parsing interface or Here or Here Look at these tutorials.

Community
- 1
- 1

user370305
- 108,599
- 23
- 164
- 151
-
if you found this answer is correct then make correct mark and upvote it for other user. Thnx. – user370305 Aug 23 '11 at 10:25
0
They are just folders in an Android project when you develop. When the app is compiled, everything in src
and res
is turned into binary code, and packed in one apk. Therefore I don't think that you will have res
folder or anything like that in the device.

romy_ngo
- 1,061
- 8
- 15