kotlin

Instant Apps - Cookie API

This sample app demonstrates how to use the Cookie API. It contains storage and retrieval of values using both, the Android Framework API and the InstantApps Play Services API. Usage This API is available to both, the Instant App as well as the Installed App, and allows to migrate user-generated data from an instant app to an installed app. The flow for this API is as follows:

Check whether the cookie fits the allowance.

Store data within the instant app.

Retrieve data from the installed app.

This API is available for API 26 or higher via PackageManagerCompat.

framework -> Android 8.0 (API level 26) or higher

-> Android 8.0 (API level 26) or higher playServices -> Any API level

Run the instant configuration

Store some data

Run the installed configuration

Retrieve the data stored earlier

Build Variants This sample has two build variants:The two build variants provide the same features, but one uses the Framework API whereas the other one uses the InstantApps Play Services API. Testing the API with this sample