SAXNotRecognizedException while using gdata api's for youtube integrating in android? -



SAXNotRecognizedException while using gdata api's for youtube integrating in android? -

i integrating youtube in android app. using gdata youtube library same.

`

youtubemanager ym = new youtubemanager(clientid); list<youtubevideo> videos; seek { videos = ym.retrievevideos(textquery, maxresults, filter, timeout); (youtubevideo youtubevideo : videos) { system.out.println(youtubevideo.getwebplayerurl()); system.out.println("thumbnails"); (string thumbnail : youtubevideo.getthumbnails()) { system.out.println("\t" + thumbnail); } system.out.println(youtubevideo.getembeddedwebplayerurl()); system.out.println("************************************"); } } grab (exception e) { // todo auto-generated grab block e.printstacktrace(); } `

i have imported jar's under, activation.jar apache-mime4j-0.6.jar gdata-core-1.0.jar gdata-media-1.0.jar gdata-youtube-2.0.jar google-collect-1.0-rc2.jar httpmime-4.0.3.jar mail.jar servlet.jar

now getting exception saxnotrecognizedexception @

videos = ym.retrievevideos(textquery, maxresults, filter, timeout);

plz can 1 tell me happening wrong on here. how prepare error? or other way integrate youtube in android app.

the root cause reported issue 9493.

http://code.google.com/p/android/issues/detail?id=9493

and workaround can found here:

http://darutk-oboegaki.blogspot.com/2011/11/solution-for-gdata-java-clients.html

securegenericxmlfactory in gdata-core intentionally disables features, of them needed retrieve info youtube. basic thought of work around follows.

(1) remove original securegenericxmlfactory gdata-core-1.0.jar

cd gdata-src.java-1.46.0/gdata/java/lib mkdir gdata-core-1.0-no-securegenericxmlfactory cd gdata-core-1.0-no-securegenericxmlfactory jar xf ../gdata-core-1.0.jar rm -rf com/google/gdata/util/common/xml/parsing jar cfm ../gdata-core-1.0-no-securegenericxmlfactory.jar meta-inf/manifest.mf com

(2) replace original gdata-core-1.0.jar new 1 created step (1). (in eclipse)

(3) re-create original source code of securegenericxmlfactory android project.

(4) add together unconditional 'return' in constructor of securesaxparserfactory before code lines disable necessary features.

// "if (true)" added avoid compilation error in eclipse. if (true) { return; }

android youtube-api gdata saxparser

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -