google-api-client

How does NodeAPI in Google Play Services work?

喜你入骨 提交于 2020-01-04 06:28:07
问题 I was trying to find the list of Nodes via getNodes() method in NodeAPI in GooglePlayServices. I have one LG G Live watch, one Samsung Gear 2 (Tizen OS) and one Google Glass. My LG G Watch has a connection with a companion APP (via GoogleAPIClient) on phone (Samsung S4). I have one application which checks if the watch is connected with phone, and if not connected, notify user about the same. I was using getNodes() method for this, and I connected glass and gear with phone with "My Glass" and

How to mock Google API AndroidPublisher request

末鹿安然 提交于 2020-01-04 06:11:01
问题 I've got a class that makes a request to the AndroidPublisher API to get the Purchases.Subscriptions.get resource. How does one mock out the OAuth request and call to get the subscription resource using the classes from the package com.google.api.client.testing? Here is the code to get the subscription: HttpTransport httpTransport = new NetHttpTransport.Builder().build(); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); GoogleCredential credential = new GoogleCredential.Builder(

Steps Data receive from History api is not matched with google fit

*爱你&永不变心* 提交于 2020-01-03 03:20:08
问题 I want google fit steps count in my application, for that I am using History api, provided by google. I found that steps receive from history api is not matched with google fit even if i used same code provided by google. Below is my code. Calendar cal = Calendar.getInstance(); Date now = new Date(); cal.setTime(now); long endTime = cal.getTimeInMillis(); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); long startTime = cal.getTimeInMillis();

Upload public object to Google Cloud Storage with public link

匆匆过客 提交于 2020-01-02 06:58:36
问题 I've searched everywhere on this but I cannot find a solution, how can I upload a public object to my google cloud storage, I want to have it so once the image is uploaded it can be viewed by anyone in the world. It seems I can only get this done if I manually click the public link in google storage, but I want to have it so I can automatically make these objects public through googles api . 回答1: The web interface doesn't provide a way to make the objects being uploaded public automatically,

Accessing public Google Drive folder from Android app without authenticating

耗尽温柔 提交于 2020-01-02 03:21:19
问题 I'd like for my app to be able to read from a pre-defined shared public Google Drive folder without the user having to log in or choose a Google account. Background / Environment Using my desktop browser, I have created a public folder on my Google Drive that is set up to be public. Anyone with the link may access (read) the drive, so no authorization is required: In my Android Studio project, I have gone into File > Project Structure > Dependencies and added com.google.android.gms:play

SSL Error in Rails 3.2.3 while using Google Oauth2 client to access API

大兔子大兔子 提交于 2020-01-01 16:48:28
问题 I'm fairly new to OAuth2 and I'm trying to access a user's Blogger account through the Google API with Omniauth and the Google API client. I'm using the following: Rails 3.2.3 Ruby 1.9.3 oauth2 (0.8.0) omniauth (1.1.1) omniauth-google-oauth2 (0.1.13) google-api-client (0.4.6) When I first tried to authenticate a user with Google credentials, I received the following error: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed However, when I added the

Upload video to youtube using php client library v3

橙三吉。 提交于 2019-12-31 05:48:06
问题 I am trying to upload a video to youtube using client library v3. The v3 library is experimental and does not have much documentation (samples provided does not include youtube) I have properly authenticated user with oauth 2.0. And when I have access token, I am trying with this code. if ($client->getAccessToken()) { $snippet = new Google_VideoSnippet(); $snippet -> setTitle = "Demo title"; $snippet -> setDescriptio = "Demo descrition"; $snippet -> setTags = array("tag1","tag2"); $snippet ->

Google OAuth2 API. Check user has two factor authentication (Not GSuite)

拜拜、爱过 提交于 2019-12-30 10:24:10
问题 I use scopes: https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email but result data of: https://www.googleapis.com/oauth2/v1/userinfo https://www.googleapis.com/oauth2/v3/tokeninfo not contains info about exist two-factor auth on google account. Can I get boolean or another value about it? 回答1: Sorry we don't expose If a user has 2 factor auth or not) through API. We have been thinking about this for a while. We have been doing a lot of things to

GoogleUser.getAuthResponse() doesn't contain access_token

懵懂的女人 提交于 2019-12-30 03:47:06
问题 UPDATE2: I revisited this issue and have solved the problem by carefully following the doco linked below. But first, for those who are struggling with this, you are in good company. There are so many versions of the doco from Google it is confusing! Do you include platform.js or client.js in your html? Do you load gapi.auth or gapi.auth2? Do you use gapi.auth2.render or gapi.auth.authorize, or gapi.auth2.init, and so on. The way that returns an access_token (as of this article date) is linked

GoogleApiClient is throwing “GoogleApiClient is not connected yet” AFTER onConnected function getting called

谁说我不能喝 提交于 2019-12-27 12:19:09
问题 So i found something that is not very clear for me about GoogleApiClient. GoogleApiClient has a function called onConnected which is ran when the client is connected (for sure) I got my own function called: startLocationListening which is eventually getting called on GoogleApiClient's onConnected function. So my startLocationListening function couldnt ran without a GoogleApiClient connection. Code and log: @Override public void onConnected(Bundle bundle) { log("Google_Api_Client:connected.");