google-api-java-client

Google Analytics 3.0 auth flow

谁说胖子不能爱 提交于 2020-01-13 09:53:53
问题 EDIT: Originally this question asked how I could authenticate with the Google Analytics API using only my API key. As vlatko pointed out, this isn't possible. Now I'm just focused on getting OAuth2 to work. I will be trying vlatko's suggestions when I get a chance and will update the question. In the meantime, feel free to contribute answers with anything you think I'm missing. ORIGINAL QUESTION: I'm trying to make requests to the Google Analytics API. I'm walking through the Hello Analytics

How to save google map in android ?and How to use tileprovider

旧巷老猫 提交于 2020-01-13 07:20:51
问题 I am creating an Android Google map using internet, but I don't know how to save Google map in an Android app. Example: Android Maps App. Please, help me 回答1: You can grub tiles from different sources. This is implementation of TileProvider which you can use with googleMap which grab GoogleMapTiles public class GoogleMapOfflineTileProvider implements TileProvider { private static final String UPPER_ZOOM_TILE_URL; static { UPPER_ZOOM_TILE_URL = "http://mt0.google.com/vt/lyrs=m&hl=ru&x=%d&y=%d

Authenticating with Google API using AccountManager

亡梦爱人 提交于 2020-01-12 07:58:10
问题 I've been struggling with this for a couple days now. I'm trying to make calls to Google Calendar using authentication via Android's AccountManager . I retrieve an auth token using the usual method: AccountManager manager = AccountManager.get(this); String authToken = manager.getAuthToken(account, AUTH_TOKEN_TYPE, true, null, null).getResult().getString(AccountManager.KEY_AUTHTOKEN); And then, with that token, I create a Calendar instance like this: HttpTransport transport = AndroidHttp

Authenticating with Google API using AccountManager

落花浮王杯 提交于 2020-01-12 07:58:08
问题 I've been struggling with this for a couple days now. I'm trying to make calls to Google Calendar using authentication via Android's AccountManager . I retrieve an auth token using the usual method: AccountManager manager = AccountManager.get(this); String authToken = manager.getAuthToken(account, AUTH_TOKEN_TYPE, true, null, null).getResult().getString(AccountManager.KEY_AUTHTOKEN); And then, with that token, I create a Calendar instance like this: HttpTransport transport = AndroidHttp

Invalid credentials: Google API calendar

痴心易碎 提交于 2020-01-10 05:49:05
问题 I am new to using Google APIs. I followed steps to setup Google Calendar sample code in eclipse using Google client library. I deployed the code to app engine using the cmd command- mvn appengine:update (when tried to deploy through eclipse it gave me an error saying the project is not an App Engine project). Deploying through command line worked and I could launch my web application. Suddenly, after few API request calls, started getting invalid credentials error: error:401 domain:global

com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example

元气小坏坏 提交于 2020-01-10 02:31:59
问题 I tried running the quickstart-sample, and this dependency: <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-drive</artifactId> <version>v2-rev78-1.15.0-rc</version> </dependency> from Drive wiki API page Yet when I try to compile the code com.google.api.client.json.jackson.JacksonFactory; is missing. To verify this you just need to do Step 2 & 3! Where can I find this class or how can I replace it in the sample? 回答1: Jackson library can be found at http://repo2

NoClassDefFoundError: com/google/api/client/util/Lists when setting up oauth2 on app engine

邮差的信 提交于 2020-01-06 13:52:41
问题 We're using the following libraries: <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-bigquery</artifactId> <version>v2-rev114-1.17.0-rc</version> </dependency> <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-drive</artifactId> <version>v2-rev98-1.17.0-rc</version> </dependency> <dependency> <groupId>com.google.apis</groupId> <artifactId>google-api-services-oauth2</artifactId> <version>v2-rev50-1.17.0-rc</version> </dependency>

Retrieve blog feeds using google oauth 2.0 and scribe

﹥>﹥吖頭↗ 提交于 2020-01-06 07:28:10
问题 I used scribe to connect to google using oAuth 2.0 and successfully got the access token. When i am trying to get the blogs i always get the below error Unauthorized Must authenticate to use 'default' user Below is the code snippet GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); oauthParameters.setOAuthConsumerKey(CONSUMER_KEY); oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET_KEY); oauthParameters.setScope("http://www.blogger.com/feeds"); oauthParameters

How to properly close Google Api Client MediaHttpUploader

六月ゝ 毕业季﹏ 提交于 2020-01-06 04:06:32
问题 I'm uploading a file use Google Api Java Client Drive service. I can't find how to close the streams. final FileContent mediaContent = new FileContent(mimeType, new java.io.File(data)); final Drive.Files.Insert insert = mDriveService.files().insert(fileMetadata, mediaContent); final MediaHttpUploader uploader = insert.getMediaHttpUploader(); uploader.setDirectUploadEnabled(false); final File file = insert.execute(); Eventually throwing Strict Mode error A resource was acquired at attached

Google Drive Rest API v3 - how to move a file to the trash?

人盡茶涼 提交于 2020-01-05 05:32:13
问题 The Google Drive Rest API v3 has a Drive.Files.Delete method, but that permanently deletes the file.How do i move the file to the trash? I looked at the docs for updating file metadata, and i tried to do this, but it doesn't seem to work: File file = new File(); file.setTrashed(true); driveService.files().update(f.getId(), file).execute(); 回答1: I don't see any error with your code on how to move a file to trash wherein you'll use files.update with {'trashed':true} . Sample code in this thread