I am new to Android development. I have an XML file with data that the app will read. Where should I keep this XML file? Should it be stored within the "value" folder?
I'd say that depends. What do you save in your XML-File? There also is a res/xml
-folder, where XML-Files can be kept. But Android does nearly anything with XML-Files, so you might want to read my little Tutorial about where to put which recourses.
Also, there is a difference between the assets
and the res
-directory's:
R
-class indexes all resources
and provides simple access.res
-directoryR
-classassets
is done using the AssetManager.You can put it in the res/raw folder. Then you will access it using:
getResources().openRawResource(resourceName)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With