xmlpullparser

Android and .NET Webservice - parsing the returned xml

跟風遠走 提交于 2019-11-28 02:19:49
问题 So I have done a few "minor" things with web services and had some success, but when I attempted to tinker around with some stuff for fun I was encountering what I believe is me incorrectly parsing out the data to get the information that I need. I can get the entire xml as a string but not just the 3 programs that I need. The getPrograms and getInstitutions are similar enough that if I can get the programs part parsed right I can get the institutions. Where I am getting confused is what I

SAX parser vs XMLPull parser

这一生的挚爱 提交于 2019-11-27 19:49:56
问题 I understand the difference between how the SAX parser works vs the XMLPull parser. In fact there's a pretty good explanation here: http://www.firstobject.com/xml-reader-sax-vs-xml-pull-parser.htm The article is a bit .NET centric but the concepts apply. While I agree with the author's opinion that the Pull parser is easier to work with, I'm pretty confused as to which type of parser would be better in which situations. If anyone could shed any light and point me to some more reading I would

Retrofit Multipart Upload Image failed

帅比萌擦擦* 提交于 2019-11-27 02:00:07
问题 I am trying to upload image with Retrofit library. This is how I am uploading: Request Code: @Multipart @POST("/customerapp/{context}/{token}/passenger/passport/add/{passengerId}") @Headers({ "Accept: application/xml", "Accept-Encoding: gzip" }) void UploadImage( @Path("context") String context, @Path("token") String token, @Path("passengerId") String passengerId, @Query("fileType") String fileType, @Query("imageCategory") int imageCategory, @Part("imageContent") TypedFile file, Callback

KXmlParser throws “Unexpected token” exception at the start of RSS pasing

血红的双手。 提交于 2019-11-26 18:17:06
问题 I'm trying to parse an RSS feed from Monster on Android v.17 using this URL: http://rss.jobsearch.monster.com/rssquery.ashx?q=java To get the content I'm using HttpUrlConnection in the following fashion this.conn = (HttpURLConnection) url.openConnection(); this.conn.setConnectTimeout(5000); this.conn.setReadTimeout(10000); this.conn.setUseCaches(true); conn.addRequestProperty("Content-Type", "text/xml; charset=utf-8"); is = new InputStreamReader(url.openStream()); What comes back is as far as

SimpleXML throws XmlPullParserException, unterminated entity ref for no reason

隐身守侯 提交于 2019-11-26 14:56:53
问题 I ran out of ideas on what the problem could be.. I'm using SimpleXML on Android, and it threw the following stacktrace: 06-08 13:20:56.450: E/AndroidRuntime(2281): FATAL EXCEPTION: main 06-08 13:20:56.450: E/AndroidRuntime(2281): java.lang.RuntimeException: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT ????T???????????????...@21:133 in java.io.BufferedReader@b6438630) 06-08 13:20:56.450: E/AndroidRuntime(2281): at com.example.stuff.manager.LevelManager.<init>