# PlayServicesStorage

Artifact: [androidx.appsearch:appsearch-play-services-storage](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/playservicesstorage/PlayServicesStorage.java+class:androidx.appsearch.playservicesstorage.PlayServicesStorage) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***

<br />

```
public final class PlayServicesStorage
```

<br />

*** ** * ** ***

An AppSearch storage system which stores data in the central AppSearch service in Google Play Services.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext` Contains information relevant to creating a global search session. |
| `public final class https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext` objects. |
| `public final class https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext` Contains information about how to create the search session. |
| `public final class https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext` objects. |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession>` | `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage#createGlobalSearchSessionAsync(androidx.appsearch.playservicesstorage.PlayServicesStorage.GlobalSearchContext)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext context )` Opens a new `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` on this storage. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession>` | `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage#createSearchSessionAsync(androidx.appsearch.playservicesstorage.PlayServicesStorage.SearchContext)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext context )` Opens a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` on this storage. |

## Public methods

### createGlobalSearchSessionAsync

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public static @NonNull ListenableFuture<GlobalSearchSession> createGlobalSearchSessionAsync(
    @NonNull PlayServicesStorage.GlobalSearchContext context
)
```

Opens a new `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` on this storage.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext context` | The `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.GlobalSearchContext` contains all information to create a new `https://developer.android.com/reference/androidx/appsearch/app/GlobalSearchSession` |

### createSearchSessionAsync

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public static @NonNull ListenableFuture<AppSearchSession> createSearchSessionAsync(
    @NonNull PlayServicesStorage.SearchContext context
)
```

Opens a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` on this storage.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext context` | The `https://developer.android.com/reference/androidx/appsearch/playservicesstorage/PlayServicesStorage.SearchContext` contains all information to create a new `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession` |