0

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 device. Ideas?

Moog
  • 10,114
  • 2
  • 38
  • 66
Blue Banana
  • 21
  • 1
  • 1
  • 2

2 Answers2

7

For write xml in android refer below link.

Writing XML on Android

For read xml there are mainly 3 ways

1) DOM Parser

2) SAX Parser

3) XML Pull Parser

Community
  • 1
  • 1
Dharmendra
  • 32,191
  • 22
  • 85
  • 127
2

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.

IncrediApp
  • 10,193
  • 2
  • 31
  • 24