PlusClient.Builder | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Ctors | Methods | Inherited Methods | [Expand All]
public static class

# PlusClient.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.plus.PlusClient.Builder

This class is deprecated.
See `GoogleApiClient.Builder`.

## Summary

Public Constructors
| PlusClient.Builder(Context context, GooglePlayServicesClient.ConnectionCallbacks connectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener connectionFailedListener) Builder to help construct the `PlusClient` object.

Public Methods
PlusClient | build() Builds a new `PlusClient` object for communicating with the Google+ APIs.
PlusClient.Builder | clearScopes() Removes all OAuth 2.0 scopes requested by your app.
PlusClient.Builder | setAccountName(String accountName) Specify an account name on the device that should be used.
PlusClient.Builder | setActions(String... actions) Specify which user's app activity types can be written to Google.
PlusClient.Builder | setScopes(String... scopes) Specify the OAuth 2.0 scopes requested by your app.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Constructors

#### public PlusClient.Builder (Context context, GooglePlayServicesClient.ConnectionCallbacks connectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener connectionFailedListener)

Builder to help construct the `PlusClient` object.

##### Parameters

context | The context to use for the connection.
connectionCallbacks | The listener where the results of the asynchronous `connect()` call are delivered.
connectionFailedListener | The listener which will be notified if the connection attempt fails.

## Public Methods

#### public PlusClient build ()

Builds a new `PlusClient` object for communicating with the Google+ APIs.

##### Returns

- The `PlusClient` object.

#### public PlusClient.Builder clearScopes ()

Removes all OAuth 2.0 scopes requested by your app.

#### public PlusClient.Builder setAccountName (String accountName)

Specify an account name on the device that should be used. If this is never called, the client will use the current default account for Google Play services for this application.

##### Parameters

accountName | The account name on the device that should be used by `PlusClient`.

#### public PlusClient.Builder setActions (String... actions)

Specify which user's app activity types can be written to Google. This must be used with the `PLUS_LOGIN` OAuth 2.0 scope.

See Types of app activity for the full list of valid app activity types. Example usage:

          plusClientBuilder.setActions(
              "http://schemas.google.com/AddActivity",
              "http://schemas.google.com/BuyActivity");

##### Parameters

actions | The user's app activity types that can be written to Google.

#### public PlusClient.Builder setScopes (String... scopes)

Specify the OAuth 2.0 scopes requested by your app. See `Scopes` for the valid OAuth 2.0 scopes.

##### Parameters

scopes | The OAuth 2.0 scopes requested by your app.

##### See Also

- `Scopes`