I would like to know how to read XML on Android without using XMLPullParser. I already tried XMLPullParser from this link https://developer.android.com/training/basics/network-ops/xml.html. It is working. It just due to my requirements, I need to read web service returns XML data in "String format" and do the processing later (not at the time I connect to HttpUrlConnection).
Right now, I am using below code and it is reading all XML data correctly except URL link in "link" tag.
val inputStream = urlCon.inputStream
reader = BufferedReader(InputStreamReader(inputStream))
builder = StringBuilder()
var line: String? = reader.readLine()
while (line != null) {
builder.append(line)
builder.append("\n")
line = reader.readLine()
}
Here is the return XML that I got from above.
By right, it should be in this https://internalws.factory.com/wh/entry?requestID=admin&id=TD12011101 format.
Any suggestion (java or Kotlin is ok for me) on my reading part? Thanks.