Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用GDataAPI时,SAXNotRecognizedException';youtube在安卓系统中的集成?_Android_Youtube Api_Gdata_Saxparser - Fatal编程技术网

Android 使用GDataAPI时,SAXNotRecognizedException';youtube在安卓系统中的集成?

Android 使用GDataAPI时,SAXNotRecognizedException';youtube在安卓系统中的集成?,android,youtube-api,gdata,saxparser,Android,Youtube Api,Gdata,Saxparser,我正在将youtube集成到我的android应用程序中。我也在使用gdata youtube库 ` YouTubeManager ym=新的YouTubeManager(clientID); 列出视频; 试一试{ videos=ym.retrieveVideos(textQuery、maxResults、filter、timeout); 用于(YoutubeVideo YoutubeVideo:视频){ System.out.println(youtubeVideo.getWebPlayerU

我正在将youtube集成到我的android应用程序中。我也在使用gdata youtube库

`

YouTubeManager ym=新的YouTubeManager(clientID);
列出视频;
试一试{
videos=ym.retrieveVideos(textQuery、maxResults、filter、timeout);
用于(YoutubeVideo YoutubeVideo:视频){
System.out.println(youtubeVideo.getWebPlayerUrl());
System.out.println(“缩略图”);
对于(字符串缩略图:youtubeVideo.getThumbnails()){
System.out.println(“\t”+缩略图);
}
System.out.println(youtubeVideo.getEmbeddedWebPlayerUrl());
System.out.println(“*************************************************”);
}
}捕获(例外e){
//TODO自动生成的捕捉块
e、 printStackTrace();
}   `  
我已经进口了jar,如下所示, 激活.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

现在我在收到一个异常SAXNotRecognitizedException

videos=ym.retrieveVideos(textQuery、maxResults、filter、timeout)


请任何人告诉我这里发生了什么事。如何修复此错误?或者以任何其他方式将youtube集成到android应用程序中。

根本原因报告为问题9493

可在此处找到解决方法:

gdata core中的SecureGenericXMLFactory有意禁用某些功能,但从YouTube检索数据需要其中一些功能。解决方案的基本思想如下

(1) 从gdata-core-1.0.jar中删除原始的SecureGenericXMLFactory

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) 用步骤(1)创建的新gdata-core-1.0.jar替换原来的gdata-core-1.0.jar。(月食中)

(3) 将SecureGenericXMLFactory的原始源代码复制到您的Android项目中

(4) 在禁用必要功能的代码行之前,在SecureSAXParserFactory的构造函数中添加一个无条件的“return”

// "if (true)" was added to avoid a compilation error in Eclipse.
if (true)
{
    return;
}

根本原因报告为问题9493

可在此处找到解决方法:

gdata core中的SecureGenericXMLFactory有意禁用某些功能,但从YouTube检索数据需要其中一些功能。解决方案的基本思想如下

(1) 从gdata-core-1.0.jar中删除原始的SecureGenericXMLFactory

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) 用步骤(1)创建的新gdata-core-1.0.jar替换原来的gdata-core-1.0.jar。(月食中)

(3) 将SecureGenericXMLFactory的原始源代码复制到您的Android项目中

(4) 在禁用必要功能的代码行之前,在SecureSAXParserFactory的构造函数中添加一个无条件的“return”

// "if (true)" was added to avoid a compilation error in Eclipse.
if (true)
{
    return;
}