-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoogleConnection.java
31 lines (26 loc) · 1.09 KB
/
GoogleConnection.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package javinator9889.securepass.backup.drive.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.drive.Drive;
/**
* Created by Javinator9889 on 22/04/2018.
*/
public abstract class GoogleConnection extends AppCompatActivity {
private GoogleSignInClient mSignInClient;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSignInClient = buildGoogleSignInClient();
}
private GoogleSignInClient buildGoogleSignInClient() {
GoogleSignInOptions signInOptions = new GoogleSignInOptions
.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(Drive.SCOPE_FILE, Drive.SCOPE_APPFOLDER)
.build();
return GoogleSignIn.getClient(this, signInOptions);
}
}