google-api-java-client

Creating a Google HTTP Transport Object for Android HTTP Request

我与影子孤独终老i 提交于 2019-12-06 04:26:21
I'm creating an Android app and trying to use Google Places API through Google APIs Client. I've been following this example: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html I'm having problems creating a HTTP Transport Object to use in creating the HTTP Request Factory. Everything compiles fine in eclipse, but when I debug while running on my phone, I get a classnotfound on the first line here: HttpTransport transport = new ApacheHttpTransport(); HttpRequestFactory httpRequestFactory = createRequestFactory(transport); public static HttpRequestFactory

gdata Unknown authorization header - started 12/11/13

核能气质少年 提交于 2019-12-06 02:35:38
The google calendar sync had been working fine for a long time now suddenly starting yesterday we started getting the following error. I saw that this has happened in the past and google engineers (SRE) had to apply a patch to fix this. com.google.gdata.util.AuthenticationException: Unknown authorization header Google Account Authentication APIs ( ClientLogin, AuthSub and OAuth 1.0 ) are deprecated as per deprecation policy. http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html Important: AuthSub has been officially deprecated as of April 20, 2012. It will

How to use Google QPX API with Java for flight search?

本秂侑毒 提交于 2019-12-06 01:41:59
问题 I am trying to build a simple Java code that obtains flight options using Google QPX API, for the flight from New York to London. I signed up with Google and got API_key. I read the documentation, but unfortunately, I couldn't find any example that show me how to do it. Here what I tried so far: import com.google.api.services.qpxExpress.model.*; import java.util.*; public class Main { public static void main(String[] args) { // Passengers PassengerCounts passengers = new PassengerCounts();

How to correctly obtain user's Calendar events using service account?

血红的双手。 提交于 2019-12-06 00:59:55
问题 I'm trying to retrive Calendar events for a user in a domain. I have service account access, but i get 404 error when I try to get specific user events. Heres connection code: NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential credential = new GoogleCredential.Builder() .setTransport(httpTransport) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(googleApiServiceAccountId) .setServiceAccountScopes(Collections.singleton(CalendarScopes.CALENDAR

members.list() in Google Admin SDK Directory API (Java)

非 Y 不嫁゛ 提交于 2019-12-05 15:12:16
I have a piece of code(in Java) to list all members of a group on a personal Google Apps Domain. This uses the google Directory API. Here is the snippet: public static void listMembers(String groupKey,Directory service) throws IOException { Members res = service.members().list(groupKey).execute(); List<Member> members = res.getMembers(); int count = 0; if (members == null || members.size() == 0) { System.out.println(); System.out.println("No members found."); } else { System.out.println(); System.out.println("Members of "+groupKey); for (Member member : members) { count++; System.out.println

Inserting a new calendarEntry in google calendar API v3 returns a 404

馋奶兔 提交于 2019-12-05 14:08:56
I use the google-api-services-calendar v3 for java. I list without problems my calendarEntries. But the insertion of a new calendarEntry fails. I use the same code as the samples : CalendarListEntry newCal = new CalendarListEntry(); newCal.setId(calTitle); newCal.setSummary(calTitle); newCal.setTimeZone("Europe/Paris"); CalendarListEntry execute = null; try { execute = service.calendarList().insert(newCal).execute(); } catch (IOException e) { e.printStackTrace(); } The calendar is not created. In the logs I have : CONFIG: {"id":"A_TEST","summary":"A_TEST","timeZone":"Europe/Paris"} 15 juin

How to get user profile on Google API using the JAVA library?

天大地大妈咪最大 提交于 2019-12-05 10:21:54
I have a Java ClientRequest to the Google API that returns a json containing the profile based in an access_token. The URL is: https://www.googleapis.com/oauth2/v1/userinfo?access_token=ya29.1.AADtN_VALuuUTBm8ENfNTz8s ... And the response is: { "id": "111223344556677889900", "email": "myemail@gmail.com", "verified_email": true, "name": "My Name", "given_name": "My", "family_name": "Name", "link": "plus.google.com/111223344556677889900", "picture": "photo.jpg", "gender": "male", "locale": "en" } Some points: 1 I'd like to use the java library to avoid mount the http request, keep the google

How to retrieve youtube thumbnails using Google API Client Library for Java

那年仲夏 提交于 2019-12-05 08:33:11
I would be obliged, if you could kindly let me know the means by which I can retrieve the youtube thumbnails using Google API Client Library for Java, similar to the way in which we fetched thumbnails using gdata. List<String> thumbnails = new LinkedList<String>(); for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) { thumbnails.add(mediaThumbnail.getUrl()); } Looking forward, Regards, Rony Using the example URL from the reference page : URL: http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2&alt=jsonc we can extract an

Connection to google Play Services Failed

一个人想着一个人 提交于 2019-12-05 04:23:40
问题 i trying to upload video using this YouTube Direct Lite App for Android project https://code.google.com/p/ytd-android/ I performed all the steps mentioned in the link. the appliction run in my android device fine but i recive toast "Connection to Play Services failed" and "An internal error occurred" toast. and this log error: 05-07 11:17:33.659: E/com.google.ytdl.UploadsListFragment(3140): Connection to Play Services Failed, error: 4, reason: ConnectionResult{statusCode=SIGN_IN_REQUIRED,

Integrating Google Sign-In into Android App

廉价感情. 提交于 2019-12-04 21:54:38
I am following https://developers.google.com/identity/sign-in/android/start-integrating guide to integrate google Sign-in into my android app. I am working on a project where Its not possible for me to put configuration file into app folder of android project. I want to know is there any alternative for that. Can I put API key in the AndroidManifest.xml as a meta-data tag under application tag instead of putting google-services.json in app directory as allowed with Google map API (reference https://developers.google.com/maps/documentation/android/start#add_the_api_key_to_your_application ) ? I