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 parsingOR
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/
This is the perfect code for new google api version 3
Api V2 is opsolete. Use V3
https://www.googleapis.com/youtube/v3/search?part=snippet&q=QUERY&maxResults=50&key=YOURKEYGOOGLECONSOLE