Tuesday, March 5, 2013

Android Show YouTube Feed for a Users Videos in a ListView ( JSON )


Hi guys, this is a Tutorial to show a list of videos that a user has uploaded to their youtube channel.
YouTube has some great API‘s for using the data from their website and you can retrieve this data in a few formats including XML and JSON. This tutorial will retrieve the data using JSON-C. This gives you the information in key value pairs and having the built in JSON library in android makes it easier and cleaner than having to parse a lot of XML.
So the plan is, talk to YouTube ask them for one users uploaded videos. YouTube will then send back a JSON object that we will retrieve the videos from and shove them into a list, sound easy huh.
What we’re going to do:
  • Create an Activity that has a button to initiate the search and a listview to display the results
  • Create a new thread that will talk to youtube and retrieve the JSON
  • Parse the JSON into nice java objects
  • Pass these objects to our ListView and display on the screen
have a look on also

http://www.youtube.com/channel/UCDUdleVTcExA9YOn-jcvfug 

https://gdata.youtube.com/feeds/api/videos?author=UCDUdleVTcExA9YOn-jcvfug&v=2&alt=jsonc

to analyze the links.


please download the source code from the link RssFeedforyoutube api's




7 comments:

  1. I have been look for building a fast and feature-rich web application for compitating modern browsers since acquiring TweetDeck in 2011 and the idea of doubling down on the TweetDeck web experience is a reflection of where power users are going.
    VPN for Android

    ReplyDelete
  2. How to load the listview without pressing the button. I want to load it automatically. Can you help me?

    ReplyDelete
    Replies
    1. Hi yes you can do it easily, it is not a big problem
      remove the code for button listener and button from the main layout and directly open the list on ONCREATE METOD.

      Delete
    2. FOR FURTHER IF YOU WANTS TO MAKE IT FROM ME THAN SEND THE CODE AT UPADHYAY.JITESH@GMAIL.COM

      Delete
  3. I want to search by keyword, then what i do, can you provide me a sample for this sir. It's urgent sir.

    ReplyDelete
    Replies
    1. Hi Hemant as you needs a search functionality over the list so you can use the blog http://upadhyayjiteshandroid.blogspot.in/2013/02/android-listviewwithsearch.html

      Delete
  4. Hello jitesh,
    Amazing post but how can i get the list of videos of my channel and what i have to pass in username in MainActivity..??

    ReplyDelete