Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.google Update packaging.yaml Sep 11, 2019
app Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
gradle/wrapper Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
LICENSE Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
NOTICE Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
README.md Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
build.gradle Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
gradle.properties Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
gradlew
gradlew.bat Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
proguard-playservices.pro
proguard.pro Updates instant-apps to proper naming style (no code changes). Sep 6, 2019
settings.gradle Updates instant-apps to proper naming style (no code changes). Sep 6, 2019

README.md

Android Instant Apps - Cookie API Sample

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:

  1. Check whether the cookie fits the allowance.
  2. Store data within the instant app.
  3. Retrieve data from the installed app.

This API is available for API 26 or higher via PackageManager and for API levels lesser than 26 via PackageManagerCompat.

Build Variants

This sample has two build variants:

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

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

  1. Run the application by checking the "deploy as instant app" in the run configuration
  2. Store some data
  3. Run the application by unchecking the "deploy as instant app" in the run configuration
  4. Retrieve the data stored earlier

Launch URL

https://hello-cookie.instantappsample.com

License

Copyright 2017 Google Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
You can’t perform that action at this time.