What's the best way to store and access XML in Android?

后端 未结 3 1503
执笔经年
执笔经年 2021-02-06 04:18

While I realize resources themselves are defined in XML files, if I have an XML file of my own type that I wish to use, should I be storing them in \"res/xml\"?

Is there

3条回答
  •  离开以前
    2021-02-06 04:52

    I would go with adding the XML resource inside the res folder with the specific resource type. Its a convention that I have adapted to, having all my files in the same directory for organization.

    If you add your XML file inside of res/xml it can be accessed anytime at run-time via Resources.getXML()

提交回复
热议问题