Read XML file in android

前端 未结 2 1807
野趣味
野趣味 2021-01-01 08:01

I have an xml-file that contains data that I want to read. The code works in a desktop environment but I can\'t figure out how to store and read the file from an android dev

2条回答
  •  再見小時候
    2021-01-01 08:52

    Put the xml file in the assets folder and fetch it using the AssetManager: http://developer.android.com/reference/android/content/res/AssetManager.html

    To read the file use the same java code that works for you on J2SE.

提交回复
热议问题