Where to place an XML file containing data within an Android app

前端 未结 3 623
南旧
南旧 2020-12-31 04:34

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?<

3条回答
  •  被撕碎了的回忆
    2020-12-31 05:03

    You can put it in the res/raw folder. Then you will access it using:

    getResources().openRawResource(resourceName)
    

提交回复
热议问题