com.google.android.gms.appindexing.AppIndexApi |
Provides methods for indexing actions that users are performing in your app to Google.
This API can be used to personalize users' Google Search experience based on usage of your app.
To use this API, add the following to yourActivity
:
protected void onCreate(...) {
mClient = new GoogleApiClient.Builder(getActivity())
.addApi(AppIndex.API).build();
...
}
protected void onStart() {
super.onStart();
mClient.connect();
Action viewAction = Action.newAction(Action.TYPE_VIEW, title, appUri);
AppIndex.AppIndexApi.start(mClient, viewAction);
...
}
protected void onStop() {
* Action viewAction = Action.newAction(Action.TYPE_VIEW, title, appUri);
AppIndex.AppIndexApi.end(mClient, viewAction);
mClient.disconnect();
super.onStop();
...
}
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AppIndexApi.ActionResult |
This interface is deprecated.
Use start(GoogleApiClient, Action) and
end(GoogleApiClient, Action) .
|
||||||||||
AppIndexApi.AppIndexingLink | An outbound link attached to viewed content. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Use
start(GoogleApiClient, Action) instead.
| |||||||||||
Indicates that the user has ended a specific action in your app.
| |||||||||||
Indicates that the user has started a specific action in your app.
| |||||||||||
This method is deprecated.
Use
start(GoogleApiClient, Action) instead.
| |||||||||||
This method is deprecated.
Use
start(GoogleApiClient, Action) instead.
| |||||||||||
This method is deprecated.
Use
start(GoogleApiClient, Action) instead.
| |||||||||||
This method is deprecated.
Use
end(GoogleApiClient, Action) instead.
|
Indicates that the user has ended a specific action in your app.
This method should be called for instantaneous actions such as TYPE_BOOKMARK
,
TYPE_LIKE
, TYPE_WANT
.
apiClient | The GoogleApiClient configured to use the
API . The client should be connecting or connected. |
---|---|
action | The Action performed by the user within the app. |
PendingResult
which can optionally be used to determine if the call
succeeded.
Indicates that the user has started a specific action in your app.
apiClient | The GoogleApiClient configured to use the
API . The client should be connecting or connected. |
---|---|
action | The Action performed by the user within the app. |
PendingResult
which can optionally be used to determine if the call
succeeded.