Skip to content

Most visited

Recently visited

navigation

Android Instant Apps API reference

Package com.google.android.instantapps

The Android Instant Apps API provides methods to help you work within the instant apps context. To use this library, you must install the Instant Apps Development SDK from the SDK Manager. For more information, see Set up your development environment.

You also must include the following Gradle dependency in the build config file for any feature module that contains calls to this API:

compile 'com.google.android.instantapps:instantapps:1.0.0'

Class Summary

Class Description
InstantApps Android Instant Apps supporting API.

Class InstantApps

java.lang.Object
   ↳ com.google.android.instantapps.InstantApps

Android Instant Apps supporting API.

Summary

Public methods
static boolean

isInstantApp(Context context)

This method returns true if the current process is an instant app.

static boolean

showInstallPrompt(Activity activity, int requestCode, String referrer)

Shows a dialog that allows the user to install the current instant app.

Public methods

isInstantApp

boolean isInstantApp(Context context)

This method returns true if the current process is an instant app.

Parameters
context Current activity or application context.
Returns
boolean If the current process is an instant app process.

showInstallPrompt

boolean showInstallPrompt(Activity activity, int requestCode, String referrer)

Shows a dialog that allows the user to install the current instant app. This method does nothing if the current running process is an installed app.

Parameters
activity The activity launching the dialog.
requestCode The requestCode to pass to Activity.startActivityForResult().
referrer The install referrer string that tracks conversions from instant app to installed app.
Returns
boolean If the install prompt is successfully displayed
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.