109 questions
0
votes
1
answer
126
views
Parse large xml file with XMLPullParser or Sax-Parser in Android causes lags
I'm having following problem: In my android tv app I can add (and later update) epg-sources, as .xml, .gz or .xz file (.gz and .xz are decompressed to .xml). So the user adds an url for a file, it ...
1
vote
0
answers
140
views
Parse XML using XmlPullParser android
I have to parse the below xml
<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
<...
1
vote
1
answer
325
views
How to parse namespaces using XmlPullParser to retreive the url link within a <media:thumbnail> tag?
I am building an RSS feed parser using XmlPullParser in Android Studio. I would like to display the feed images in my app, however I am having trouble retrieving the url attribute value in the <...
1
vote
1
answer
864
views
XmlPullParser Read value inside a Tag with Kotlin
I have the following rss: https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml and I can read all the info with no problem but one tag:
<media:content height="151" medium="image&...
0
votes
1
answer
3k
views
Attempt to invoke virtual method 'java.lang.String' on a null object reference when extracting data using from an arraylist
I am new to this platform and i've been stuck at this error for sometime i've searched for this error online but non of the answers seem to satisfy my case. I am trying to extract data using ...
0
votes
0
answers
143
views
Android App crashing only on specific Tablets - XmlPullParserException
I have an app published on Google Play. For two months, some crashes appear on my Google Play Console. The log is pasted below. Note that this crash so far only appeared for owners of those devices: ...
1
vote
1
answer
198
views
XmlPullParser skip from START_DOCUMENT to END_DOCUMENT eventType
I'm trying to parse xml file in Android app. When I'm trying to process it I don't receive eventType except START_DOCUMENT and END_DOCUMENT right after START. It looks like I will deliver empty file ...
0
votes
1
answer
39
views
XmlPullParser skipping START_TAG?
So I'm trying to parse a GPX file using the XmlPullParser.
For the most part, I have it working, but noticed that I'm not getting what I'm expecting.
A snippet of the file:
<?xml version="1.0" ...
1
vote
0
answers
377
views
How to parse AWS S3 XML in android using xml parser or any other parser .?
How to read this amazonaws s3 XML in android using xml parser.
i user parser but now working and provide null value. how to resolve this issue thanks in advance
AWS S3 XML_FILE:
<ListBucketResult ...
1
vote
0
answers
174
views
Android Proguard: XmlPullParser issues
I have enabled Proguard for my project, It produces multiple warnings related to org.xmlPullParser package, see picture:
TL;DR:
How do I solve this, I tried many things already.
UPDATE
Opening a ...
0
votes
0
answers
98
views
XmlResourceParser stays at the START_DOCUMENT state after calling next()
The following code throws an exception at the 4th line
XmlResourceParser parser = context.getResources().getXml(R.xml.file);
parser.require(XmlPullParser.START_DOCUMENT, null, null);
parser.next();
...
1
vote
1
answer
522
views
Inflate and render a UI view by a downloaded xml string
I was interested in downloading the xml layout for UI views from a server and inflate that as an xml string.
What I see in the doc though is:
Therefore, it is not currently possible to use ...
1
vote
2
answers
158
views
Android res/xml cannot escape apostrophe in any way
I have some XML files in res/xml and I'm trying to escape characters as you would normally do in XML. I tried nearly every way possible:
<tag>Okay, I'll do it</tag>
<tag>Okay, I\'ll ...
0
votes
1
answer
987
views
XMLPullParser not finding START_TAGs
I am attempting to parse XML data from the following URL
Traffic Scotland Current Incidents
Right now, I have an app that, on button press, gets the XML data, attempts to parse it, and then just ...
3
votes
1
answer
486
views
XmlResourceParser.getText() drops text after single quote char, ignores double quotes
Currently trying to implement an Android version of my iOS application and running into some issues parsing XML where the text contains a single quote or double quote character (it's a dictionary app ...
0
votes
2
answers
1k
views
Android Studio Java XmlPullParser how to get only certain tag values
I'm having trouble parsing some xml tags. I'm very new to Android development and I'm still struggling with basics.
I'm sorry if this post is sort of hard to read.
I want to read the following XML ...
2
votes
2
answers
136
views
Parse channel node using XmlPullParser
I'm trying to parse the channel node from an RSS feed but I keep getting this error thrown at parser.nextText():
org.xmlpull.v1.XmlPullParserException: precondition: START_TAG (position:END_TAG </...
0
votes
2
answers
783
views
Parse all XML text using XMLPullParser
I have a question that is similar to [this one here][1]
I have read tutorials about XMLPullParser and do not seem to get this one.
I have an XML tag I want to parse using XMLPullParser
<dt>
: ...
1
vote
0
answers
65
views
How can I get dynamic xml file? which is the latest instance instead of the originally loaded xml file
I use these lines of code to extract and parse the xml layout.
Activity activity = MyClassName.this;
Resources res = activity.getResources();
XmlResourceParser xpp = res.getXml(R.layout....
1
vote
0
answers
197
views
Android XmlPullParser: read namespaces in RSS Feed
I'm parsing an XML feed that looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cc="http://web.resource.org/...
-1
votes
1
answer
59
views
XML parser having issues
i have been trying to parse a xml which look like this. is this correct format of xml is so how to parse it. And i want to know what is the format of xml.
<string xmlns="http://schemas.microsoft....
0
votes
1
answer
232
views
XMLPullParser - Skips all tags
I need to read a XML using XMLPullParser. But when I try to parse it my eventType starts with 0 (i.e., START_DOCUMENT) and immediately skips to 1 (i.e., END_DOCUMENT) thereby skipping all the other ...
0
votes
1
answer
131
views
Android : XmlSerializer or FastXmlSerializer writes & for &
In android, when writing some values containing '&' in the text part, FastXmlSerializer.attribute() or Xml.newSerializer().attribute(), method encodes '&' as '& ;'. Is there any other ...
0
votes
1
answer
191
views
How can i identify same xml tag second time
I am not full aware of XMLParsing so i am beginner in XMLParsing. I am using XMLPull parser.
i wanna to store player one and player two in below xml. How can i identify playertag??
<scores sport="...
0
votes
2
answers
2k
views
How to parse this xml file in android - XmlPullParser?
I am confused that how to parse this xml and go to next tag
rss --> channel --> item
The xml tree like this structure , please help me through it.
Thanks in advance.
link of xml file
<rss>
...
0
votes
1
answer
532
views
While i am parsing XML , the text in CDATA Section doesn't seem regular
i am parsing xml from a website. But while parsing, the text in the CDATA section doesn't seem like a regular text. For example, the text contains ’ for the character " ' " . How can i solve ...
1
vote
1
answer
383
views
android XmlPullParser parse xml to Listview
i have listgender.xml store in asset folder like this:
<gender>
<sex>male</sex>
<sex>female</sex>
</gender>
this is class gender :
public class ...
0
votes
2
answers
1k
views
Why we use Callback response in enqueue method of OKhttp in android
I just made a simple JSON parsing program with Okhttp now what is Callback in Response of OKhttp and Why we use this ?
OkHttpClient okHttpClient=new OkHttpClient();
Request request=new ...
-1
votes
1
answer
51
views
What is the best way to handle this background process while updating UI?
My app will update a list of bus routes once every 2 weeks from the transit API in the background as a service and will store the list in sharedpreferences. When the user starts the app for the first ...
0
votes
1
answer
78
views
Download file from XMLPullParser
I am quite new developer.
I am building an app with AndroidStudio that read an XML file from server with PullParser. I need to download a file.zip from xml link and when I press the buttonDownload(...
21
votes
8
answers
18k
views
XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0
This is a follow up question to this question:
Update Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0
I ...
3
votes
2
answers
2k
views
Modify xml attributes values using XmlPullParser
I have an XML (actually a String) and I want to find all tags which contain attributes width and height and to modify their values.
XML example:
<div>
<div class="separator" style="clear: ...
4
votes
1
answer
330
views
Android LayoutInflater: inflate Binary layout xml
I am trying to dynamically inflate an layout xml file.
The file should later come from a server so the Android app (client) will download it and load the layout.
I know that its impossible to do this ...
1
vote
0
answers
111
views
Google Cloud Storage XML API Policy document accessed through Google CloudEndpoint API. Lexical Error: Unmatched input
I am getting the following error
InvalidPolicyDocumentThe content of the
form does not meet the conditions specified in the policy
document.Policy document parsing error: Lexical
Error: ...
0
votes
1
answer
480
views
XmlPullParser.getText() return null or "" in this situation?
The XML file is:
<name></name>
If I parse the XML with:
String result = null;
if (parser.next() == XmlPullParser.TEXT) {
result = parser.getText();
parser.nextTag();
}
return ...
2
votes
0
answers
59
views
xml nodes are not being skipped using XmlPullParser
i have gone through already asked questions , but none of them is the solution for my problem.
after running some programs, i guessed that we can not skip any tag in xml data processing once we start ...
0
votes
1
answer
399
views
troubles parsing local xml file with xmlPullParser in android xmlPullParserException
Hi guys I am having an issue with xmlPullParser. I am trying to follow along with the google developers tutorial with a slight modification. Iam reaing the xml file from the raw resource file. the ...
0
votes
0
answers
120
views
get tag name from xsi:type using xmpullparser
I have following XML file:
<refObjects xsi:type="xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id>123</id>
<tagfoo>Name 1</tagfoo>
</refObjects>
<...
0
votes
1
answer
549
views
Parsing XML feed in Android using XMLParser
So I have been through countless tutorials and tried a bunch of different ideas, but for the life of me can not figure out how to parse my xml feed below. I'm trying to access the values in the '...
8
votes
1
answer
8k
views
How to parse XML return from OkHttp?
This is my OkHttp Post Form Parameter Method using OkHttp's Async Get
public Call postGetCountries(Callback callback) {
RequestBody body = new FormEncodingBuilder()
.add("op", "op")
...
2
votes
0
answers
56
views
Android: XmlPullParser does not give correct Attribute sets from Xml file
This is my xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:...
1
vote
1
answer
267
views
XmlPullParser handling multidimensional repeated elements
Im trying to get a list of the top level elements from my XML (that contains duplicated sub elements)
example XML
<feed>
<folder name="subfolder1">
<file name="subfile1" /&...
-2
votes
1
answer
366
views
android.os.NetworkOnMainThreadException in XmlPullParser [duplicate]
I use google places api to return a list of interesting places nearby. Each place and its attributes are enclosed in result and /result tag.
After encountering the first /result tag I get Network on ...
1
vote
2
answers
2k
views
XmlPullParser getAttributeValue always returns null
I'm trying to parse an xml file. But method getAttributeValue always returns null for me. First of all here's the xml file
<note>
<to>Tove</to>
<from>Jani</from>
<...
1
vote
1
answer
1k
views
How to get a specific node value in XML Pull Parser
I am using the following code to parse XML, it has been referenced from the official Android Docs:
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
...
0
votes
0
answers
596
views
Android XML parsing from internal storage
I'm trying to read and write XML file using DOM and PullParser. I inspired a part of this code from this link http://www.phonesdevelopers.com/1707053/.
This is the main activity:
public class ...
0
votes
1
answer
2k
views
How to tell if the city is incorrect in Android openweatherMap API?
I'm using XmlPullParser to parse the weather information from the API. My application shows the weather information once the user entered his city (input). If I enter enter "London" in the text box, ...
1
vote
1
answer
883
views
How can I extract an Image URL from RSS feed XML in android
Currently I am working on an app that reads in and displays feeds from RSS data, I am able to parse and display the title of the article (the RSS feed is BBC news) and the description of the article, ...
0
votes
0
answers
900
views
How to use XmlPullParser with UTF-8?
I'm trying to decode a XML using XmlPullParser with UTF-8 but something is going wrong because when a string is "dirección" I am getting "direcci& #xf3;n" (without spaces between & and #).
I ...
0
votes
1
answer
251
views
How to create xml items list programmatically in Android?
I am using an external API for some actions. One of the method takes a list of menu(xml) items like:
----.shape(R.menu.list).---
And here is my R.menu.list file:
<?xml version="1.0" encoding="...