Answer the question
In order to leave comments, you need to log in
How to read text from xml file in android application?
Hello. There is an xml file on the server that looks like this:
<response>
<date_act>2015-05-05</date_act>
<symbol>U</symbol>
<rate>2517</rate>
<size>1</size>
</response>
Answer the question
In order to leave comments, you need to log in
if only this then get a request for xxx/file_name.xml and in the response a line will come in which will be the contents of the xml file.
As an option.
Use Jsoup java library .
Jsoup is an HTML parser, but I think there will be no problems with such an XML file.
In addition, this library can also generate HTTP requests. On off. There are plenty of examples of Get requests and file navigation in the Cookbook section of the site.
Upload url to Asynctask. Pass the result to XmlPullParser.
You need a book. Brian Hardy, Bill Phillips - Android Programming. from page 429.
Better yet, from the first to the last.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question