本文介绍了没有得到的YouTube视频列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照有关如何使用YouTube gdata的教程。填充与从YouTube和视频的onclick列表视图。该人士$ ​​C $ C可以用:

在我已经改变了的YouTube链接的GData

从:

的\"+username+\"&v=2&alt=jsonc

影片

我没有得到列表中,为什么?


解决方案

原因是它不工作的原因是:

从这个网址:

的\"+username+\"&v=2&alt=jsonc

你得到JSON字符串的响应为gdata.youtube.com

在这个网址:

您得到RSS XML响应中为gdata.youtube.com

解决方案:

要使它工作,你需要改变JSON字符串在 GetYouTubeUserVideosTask 解析类XML解析

使用这个网址为JSON格式获取数据:

和我们如何在Android中解析JSON使用本教程来已知的:

I have followed a tutorial on how to use the youtube gdata. Populating a listview with videos from youtube and a onclick. The source code is available on:

http://blog.blundell-apps.com/click-item-in-a-listview-to-show-youtube-video/

Once i have changed the YouTube GData link

from:

https://gdata.youtube.com/feeds/api/videos?author="+username+"&v=2&alt=jsonc

to :

http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads

i am not getting list of videos, why?

解决方案

Reason is it's not working because :

From this URL :

https://gdata.youtube.com/feeds/api/videos?author="+username+"&v=2&alt=jsonc

you are getting JSON String in Response for gdata.youtube.com

and

In this URL :

http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads

you are getting Rss XML in Response for gdata.youtube.com

SOLUTION :

to make it working you will need to change JSON String parsing in GetYouTubeUserVideosTask class to XML parsing

OR

use this URL for getting data in JSON format :

http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?v=2&alt=jsonc

and use this tutorial to known how we parse json in android :

http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

这篇关于没有得到的YouTube视频列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:44