Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:36:01+00:00 2026-06-11T00:36:01+00:00

I am able to get the Youtube content using JAVA. Please help me out

  • 0

I am able to get the Youtube content using JAVA. Please help me out to fetch the data in Android.

Here’s the code in Java:

public class YouTubeTest 
{

public static void main(String[] args) 
    {
   try {
        YouTubeService myService = new YouTubeService("mycompany-myapp-1");

        String myFeed = "http://gdata.youtube.com/feeds/videos?start-index=1&max-results=25&q=earth";

       printVideoFeed(myService, myFeed);
   } 
       catch (IOException ex) {
        Logger.getLogger(YouTubeTest.class.getName()).log(Level.SEVERE, null, ex);
    } 
        catch (ServiceException ex) {
        Logger.getLogger(YouTubeTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

private static void printVideoFeed(YouTubeService service, String feedUrl) throws IOException, ServiceException {
    VideoFeed videoFeed = service.getFeed(new URL(feedUrl), VideoFeed.class);
    List<VideoEntry> allVideos = videoFeed.getEntries();
    Iterator<VideoEntry> itAllVideos = allVideos.iterator();
    while (itAllVideos.hasNext()){
        VideoEntry oneVideo  = itAllVideos.next();
        TextConstruct oneVideoTitle = oneVideo.getTitle();
        String oneVideoTitleText = oneVideoTitle.getPlainText();

        //Print titles of all videos:
        System.out.print(oneVideoTitleText);

        List<Person> allAuthors = oneVideo.getAuthors();
        Iterator<Person> itAllAuthors = allAuthors.iterator();
        while (itAllAuthors.hasNext()){
            Person oneAuthor = itAllAuthors.next();
            //Print authors of current title:
            System.out.print(" (by " + oneAuthor.getName() +")");
        }
        YtStatistics views= oneVideo.getStatistics();
        System.out.print("\t "+views.getViewCount());

    }
}

}

I’ve included :
mail.jar
activation.jar
gdata-client-1.0.jar
gdata-client-meta-1.0.jar
gdata-core-1.0.jar
gdata-media-1.0.jar
gdata-youtube-1.0.jar
gdata-youtube-meta-1.0.jar

When I am trying the same code in android it gives exception:

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError:com.google.gdata.client.youtube.YouTubeService

        at com.example.youtry.YouTubeTest.abcd(YouTubeTest.java:32)
    at com.example.youtry.MainActivity.onCreate(MainActivity.java:15)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)

Please Help Me Out!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:36:03+00:00Added an answer on June 11, 2026 at 12:36 am

    my suggestion is you can use json Api for getting all types of Youtub Vedioe and you can easily parse it, and get the require details.

    like contains types vidieo
    String[] MatchItem={“top_rated”,”top_favorites”,”most_viewed”,”most_popular”,”most_recent”};

    // usefull url

    strUrlmy = “http://gdata.youtube.com/feeds/api/standardfeeds/”+MatchItem[position]+ “?
    v=2&alt=json”;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

not able to get this, can someone help for this LINQ query? select col1,
I am able to get the output of a pdf using fpdf, the problem
Previously i was able to download YouTube videos as mp3 via youtube-mp3.org Using this
Trying to parse a YouTube feed using PHP simplexml_load_file(); I am able to access
I need to be able to directly download certain YouTube videos using PHP. Based
I'm using the code from this question to autoplay an iframe embedded Youtube video
all I want to display youtube subscriber using its api. But not able to
I'm using jQuery Templates to Embed user posted YouTube vids. I am able to
I'm trying to code a progress bar...i'm using the youtube api to create custom
I'm trying to delete videos using the YouTube API v2. I've been able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.