The Google Sign-In Android quickstart demonstrates how to authenticate a user with GoogleSignInClient.
If you've found an error in this sample, please file an issue: https://github.com/googlesamples/google-services/issues
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.
Copyright 2015 Google, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
compileSdkVersion 25
applicationId "com.google.samples.quickstart.signin"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.google.android.gms:play-services-plus:9.6.1'
compileSdkVersion 26
applicationId "com.google.samples.quickstart.signin"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.api-client:google-api-client-android:1.22.0'
compile 'com.google.apis:google-api-services-people:v1-rev139-1.22.0'
package com.google.samples.quickstart.signin
uses-permission
package com.google.samples.quickstart.signin
Simple list-based Activity to redirect to one of the other Activities. The code here is uninteresting, {@link SignInActivity} is a good place to start if you are curious about {@code GoogleSignInApi}.
Activity to demonstrate basic retrieval of the Google user's ID, email address, and basic profile.
Activity to demonstrate basic retrieval of the Google user's ID, email address, and basic profile, which also adds a request dialog to access the user's Google Drive.
Demonstrates retrieving an ID token for the current Google user.
Validates that there is a reasonable server client ID in strings.xml, this is only needed to make sure users of this sample follow the README.
Demonstrates retrieving an offline access one-time code for the current Google user, which can be exchanged by your server for an access token and refresh token.
Validates that there is a reasonable server client ID in strings.xml, this is only needed to make sure users of this sample follow the README.
Activity to demonstrate using the Google Sign In API with a Google API that uses the Google Java Client Library rather than a Google Play services API. See {@link #getContacts()} for how to access the People API using this method. * In order to use this Activity you must enable the People API on your project. Visit the following link and replace 'YOUR_PROJECT_ID' to enable the API: https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=YOUR_PROJECT_ID