Simple client for YouTube Data API (v3) on Android.
In your build.gradle
:
compile 'com.hatenablog.shoma2da.android:android-youtube-data-api-client:0.0.1'
In your Application
class (or first Activity
) :
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
AndroidYoutubeDataApiClient.setApiKey(YOUR_GOOGLE_API_KEY);
}
}
You can search videos by word :
SearchResultList list = AndroidYoutubeDataApiClient.search(SEARCH_WORD); //Caution! Please run it on worker thread.
for (SearchResultItem item : list) {
//use result items here
}