Friday, July 13, 2012

[YouTube-API] Re: Youtube data api on android forceclose....

Hello Christian,

 The existing GData Java client library doesn't play nicely with Android. I wouldn't recommend using it.

 The new Google APIs client library for Java (http://code.google.com/p/google-api-java-client/) has good Java support, and that's what I'd recommend using eventually. The new client library is meant to work with the YouTube Data API v3 (https://developers.google.com/youtube/v3/), which currently is in an invite-only preview release.

 In terms of what you can actually use today, I'd recommend just using a generic HTTP library to make your requests. Something like this should work, and you can add alt=json to your request URLs to get back JSON-formatted data:

  http://turbomanage.wordpress.com/2012/06/12/a-basic-http-client-for-android-and-more/

 You can use the Android account manager to handle authentication. There's an example at

  http://code.google.com/p/ytd-android/source/browse/trunk/src/com/google/ytd/GlsAuthorizer.java

Cheers,
-Jeff Posnick, YouTube API Team
apiblog.youtube.com | Google+: http://goo.gl/bZflZ


On Monday, June 25, 2012 12:08:49 AM UTC-4, christian murphy wrote:
I am trying to hook up the youtube api for an android app, i downloaded all the required jars and started to follow the examples at https://developers.google.com/youtube/2.0/developers_guide_java#Retrieving_and_searching_for_videos

I tried putting in "YouTubeService service = new YouTubeService(clientId,develober_key)" and "service.setUserCredentials("user@gmail.com", "mypassword");". 

When i try to run the app i get a forceclose with the error message "06-24 21:27:24.286: E/AndroidRuntime(10191): java.lang.NoClassDefFoundError: com.google.gdata.client.youtube.YouTubeService"
Which i see is included in my reference libraries folder. Could there be something wrong with the class, or am i missing something?


All I want to do is show a list of my videos inside of a listview on an android application. Am I missing any requirements? What further steps do I have to take to get the authentication running? Is there a simpler way to do this?

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/3N6Bir4FDDIJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment