java.lang.Object | |
↳ | com.google.android.gms.common.api.GoogleApiClient.Builder |
Builder to configure a GoogleApiClient
.
Example:
GoogleApiClient client = new GoogleApiClient.Builder(this) .addApi(Plus.API) .addScope(Plus.SCOPE_PLUS_LOGIN) .setAccountName("users.account.name@gmail.com") .build(); client.connect();
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Builder to help construct the
GoogleApiClient object. | |||||||||||
Builder to help construct the
GoogleApiClient object. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Specify which Apis are requested by your app.
| |||||||||||
Specify which Apis are requested by your app.
| |||||||||||
Registers a listener to receive connection events from this
GoogleApiClient . | |||||||||||
Adds a listener to register to receive connection failed events from this
GoogleApiClient . | |||||||||||
Specify the OAuth 2.0 scopes requested by your app.
| |||||||||||
Builds a new
GoogleApiClient object for communicating with the Google
APIs. | |||||||||||
Specify an account name on the device that should be used.
| |||||||||||
Specifies the part of the screen at which games service popups (for example, "welcome
back" or "achievement unlocked" popups) will be displayed using gravity.
| |||||||||||
Sets a
Handler to indicate which thread to use when invoking callbacks. | |||||||||||
Sets the
View to use as a content view for popups. | |||||||||||
Specify that the default account should be used when connecting to services.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Builder to help construct the GoogleApiClient
object.
context | The context to use for the connection. |
---|
Builder to help construct the GoogleApiClient
object.
context | The context to use for the connection. |
---|---|
connectedListener | The listener where the results of the asynchronous
connect() call are delivered. |
connectionFailedListener | The listener which will be notified if the connection attempt fails. |
Registers a listener to receive connection events from this GoogleApiClient
.
Applications should balance calls to this method with calls to
unregisterConnectionCallbacks(ConnectionCallbacks)
to avoid leaking resources.
If the specified listener is already registered to receive connection events, this method will not add a duplicate entry for the same listener.
Note that the order of messages received here may not be stable, so clients should not rely on the order that multiple listeners receive events in.
listener | the listener where the results of the asynchronous connect() call
are delivered.
|
---|
Adds a listener to register to receive connection failed events from this
GoogleApiClient
. Applications should balance calls to this method with calls to
unregisterConnectionFailedListener(OnConnectionFailedListener)
to avoid leaking
resources.
If the specified listener is already registered to receive connection failed events, this method will not add a duplicate entry for the same listener.
Note that the order of messages received here may not be stable, so clients should not rely on the order that multiple listeners receive events in.
listener | the listener where the results of the asynchronous connect() call
are delivered.
|
---|
Builds a new GoogleApiClient
object for communicating with the Google
APIs.
GoogleApiClient
object.
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.
accountName | The account name on the device that should be used by
GoogleApiClient .
|
---|
Specifies the part of the screen at which games service popups (for example, "welcome back" or "achievement unlocked" popups) will be displayed using gravity.
Default value is TOP
|CENTER_HORIZONTAL
.
gravityForPopups | The gravity which controls the placement of games service popups. |
---|
Sets a Handler
to indicate which thread to use when invoking callbacks. Will not
be used directly to handle callbacks. If this is not called then the application's main
thread will be used.
Sets the View
to use as a content view for popups.
viewForPopups | The view to use as a content view for popups. View cannot be null. |
---|
Specify that the default account should be used when connecting to services.