Android Youtube Api Not Calling VideoId

358
August 10, 2017, at 03:44 AM

When I go to video search I get this error. Previously it was making a smooth call any video. I did not understand what happened? 2 days I am investigating this problem ...

Current api jar google-api-client-1.21.0.jar

google-api-services-youtube-v3-rev183-1.22.0.jar

google-http-client-1.21.0.jar

google-http-client-android-1.21.0.jar

google-http-client-jackson2-1.21.0.jar

package com.eliteux.minitube;
import android.content.Context;
import android.util.Log;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.youtube.YouTube;
import com.google.api.services.youtube.model.SearchListResponse;
import com.google.api.services.youtube.model.SearchResult;

import java.io.IOException;
import java.util.List;

public class YoutubeConnector {
    private YouTube youtube;
    private YouTube.Search.List query;
    public static final String YOUTUBE_KEY = "131242141241512";
    public YoutubeConnector(Context context) {
        youtube = new YouTube.Builder(new NetHttpTransport(),
                new JacksonFactory(), new HttpRequestInitializer() {
            @Override
            public void initialize(HttpRequest hr) throws IOException {
            }
        }).setApplicationName(context.getString(R.string.app_name)).build();
        try {
            query = youtube.search().list("id,snippet");
            query.setKey(YOUTUBE_KEY); //TODO: Create a class in the same package with your Youtube API key as a static string.
            query.setType("video");
            query.setMaxResults(50L);
            query.setFields("items(id/videoId,snippet/title,snippet/description,snippet/thumbnails/default/url,snippet/channelTitle)");
        } catch (IOException e) {
            Log.d("YoutubeConnector", "Could not initialize: " + e);
        }
    }
    public void search(String keywords, List<VideoItem> items) throws IOException {
        query.setQ(keywords);
        try {
            SearchListResponse response = query.execute();
            List<SearchResult> results = response.getItems();
            items.clear();
            for (SearchResult result : results) {
                VideoItem item = new VideoItem();
                item.setTitle(result.getSnippet().getTitle());
                item.setChannelTitle(result.getSnippet().getChannelTitle());
                item.setDescription(result.getSnippet().getDescription());
                item.setThumbnailURL(result.getSnippet().getThumbnails().getDefault().getUrl());
                item.setId(result.getId().getVideoId());
                items.add(item);
            }
        } catch (IOException e) {
            Log.d("YoutubeConnector", "Could not search: " + e);
            throw e;
        }
    }
    public void autocomplete(String keywords, List<String> items) {
        //TODO: Everybody is wants
        throw new UnsupportedOperationException("Not implemented");
    }
}
Rent Charter Buses Company
READ ALSO
How can i create a date and time picker as in the below image

How can i create a date and time picker as in the below image

i need some lead on how i could develop time slot picker as show in the below screen shot

258
Replicating CouchDB with Cloudant fails

Replicating CouchDB with Cloudant fails

I have a CouchDB database and I want to replicate it on an Android device using Cloudant

265
How to find baseband version adb?

How to find baseband version adb?

I am currently trying to get my Wileyfox Swift 2 fixed for a boot-loop caused by installing a custom recoveryAll is going well apart from the support agent asking for the baseband version

553
Event tracking on google analytics doesn&#39;t work

Event tracking on google analytics doesn't work

I followed google's documentations to track my appScreens view is working

283