Ir al contenido

Más visitados

Visitados recientemente


Preparing your app for Instant Apps

The best instant app experiences are focused on helping the user accomplish a task quickly, like watching a video or making a purchase. You can start getting your app ready for Android Instant Apps by working through the following steps. Many of these are considered best practices for Android apps generally.

Implementing runtime permissions from Android 6.0

Android Instant Apps requires using runtime permissions that are introduced in Android 6.0 (API level 23). Instant apps framework ensures that the features operate on devices running Android 5.1.1 (API level 22) or lower. As such, make sure your app targets Android 6.0 (API level 23) or higher and uses runtime permissions. For more information on how to update your app to use Android 6.0 permissions and how to request permissions at runtime, see Requesting Permissions at Run Time.

Android Instant Apps uses URLs for all navigation. When a user taps a link to your instant app, they go to a specific activity within your app. If the link fails or the user taps the link on an unsupported device, the browser opens and shows your website. Also, an activity cannot launch another activity directly within an instant app; rather, it must request the URL address that corresponds to that activity.

Both your instant and installable versions of your app must implement the Android App Links feature introduced in Android 6.0. App Links provide the primary mechanism for connecting URLs to discrete activities within your app. It is recommended that your app supports both www and non-www domains. To get started with App Links, see the information on Handling Android App Links.

In addition, an instant app cannot launch an activity in another feature directly; instead, it must request the URL address that corresponds to the other other feature's entry-point activity. For more information, see Implement app links.

Defining entry points for your app

You need to use URL entry points or deep links to launch instant apps from a URL. Add intent filters for incoming links to add URL entrypoints or deep links in your application. For more details, see Implementing deep Links

Additionally, to allow Google Play and Android launcher to discover your app, you must provide at least one activity as the entry point for your app. In the app manifest, the entry point activity must have an <intent-filter> element that includes the CATEGORY_LAUNCHER and ACTION_MAIN intents.

You must also define a default URL for your app. Within the same Android manifest as your entry-point activity, define the default URL by adding a <meta-data> element with a value attribute that provides a valid HTTPS URL. The activity should be able to handle the default URL. The default URL must also be a part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.

The following code snippet shows an Android manifest that defines an entry-point activity and default URL for an instant app.

      <action android:name="android.intent.action.MAIN" />
      <category android:name="android.intent.category.LAUNCHER" />
    <intent-filter android:autoVerify="true">
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <category android:name="android.intent.category.BROWSABLE" />
      <data android:scheme="http" />
      <data android:scheme="https" />
      <data android:host="" />
      android:value="" />

Adhering to the Instant apps sandbox restrictions

Instant apps are run within a tighter sandbox for security reasons. Hence they are required to adhere to the policy restrictions of the sandbox:

Removing any unnecessary bulk from your app

Get rid of any unknown or unnecessary permissions, components, third-party dependencies, and libraries. Removing these items can reduce the size of your app and improve performance significantly. For more information about identifying permissions specified in your app manifest, see <uses-permission> and App Manifest.
For more information about identifying and removing unncessary components from your app, see Reduce APK Size.

Refactoring your app, if necessary

Android Instant Apps need to be structured into URL-addressable modules that are lesser than 4MB in size. For apps that are larger than 4MB, you must refactor the app into smaller modules that can be downloaded and run independently in response to URL navigation. You are free to choose what to include in each module, but it is recommended to isolate distinct user flows into different modules. This gives a fast and responsive experience within a flow and additional modules are downloaded only when the user switches flows. For example, when building a retail experience, you can separate your app into four modules: browse, search, item detail, and checkout to allow the user to download modules as needed throughout the purchase flow.

Implementing Smart Lock for Passwords if your app authenticates users

For instant apps that include login, you must integrate Smart Lock for Passwords. This allows users to quickly and securely sign in by using the credentials they have saved, as well as for users to remain signed in across app visits. For more information about implementing Smart Lock in your app, see Smart Lock for Passwords on Android.

Accepting payments with the Google Payment API

For accepting payments, Android Instant Apps is compatible with Google Play In-app Billing for digital goods and the Google Payment API for physical goods and services.

Implementing the Google Payment API

With the Google Payment API, your app can request any credit or debit card from the user's Google account, as well as Google Pay payment credentials. PAYMENT_METHOD_TOKENIZATION_TYPE_GATEWAY is required for Android Instant Apps

We recommend you use a generic purchase button. For example, use button labels such as "Buy", "Checkout", or "Purchase" to initiate the payment flow with the Google Payment API. If you prefer, you may use an approved “Pay with Google” asset button available here.

        new View.OnClickListener() {
            public void onClick(View view) {
               PaymentDataRequest request = createPaymentDataRequest();
               if (request != null) {
                           paymentsClient.loadPaymentData(request), this,
private PaymentDataRequest createPaymentDataRequest() {
        PaymentDataRequest.Builder request =

PaymentMethodTokenizationParameters params =
           //Please refer to your gateway to confirm the parameters to pass
                        .addParameter("gateway", "yourGateway")


For more information about implementing Google Payment API, see the Google Payment API developer documentation.

Identifying tested compatible libraries

Android Instant Apps are compatible with a large selection of Google libraries, including those in the following list.

When debugging an instant app that uses a Google Play services library other than those included in the list above, you may see the API_UNAVAILABLE error in your debugging output. The API_UNAVAILABLE error indicates that the library has not been adapted for usage in Android Instant Apps.

Identifying allowed implicit broadcast intents

An instant app can receive the following broadcast intents:

In addition, instant apps can receive broadcast intents that have the Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS flag set.

Identifying restricted and unsupported features

User expectations may vary for apps that are installed as opposed to apps accessed via URL. Thus, certain functionality available to installed apps is not available to instant apps. Developers using any of the below functionality must refactor their app to move unsupported features to a separate library module to be included only in their installed app.

Addressing additional app requirements

In addition to other requirements listed on this page and elsewhere in the Android Instant Apps documentation, you must do the following to prepare your instant app:

Restricted features

Caution: An instant app cannot use alternate means to bypass the restrictions described above. Do not attempt to use custom APIs or functionality provided by device manufacturers. Google will remove apps that violate these restrictions.

Unsupported features

Hardware Acceleration

Android Instant Apps support OpenGL ES 2.0 with the exception of context share groups. The following extensions are supported:

Utilizamos cookies para registrar tus preferencias de idioma y visualización de este sitio web.

Recibe novedades y consejos para desarrolladores de Android que te ayudarán a alcanzar el éxito en Google Play.

* Campos obligatorios

¡Ya está!

Seguir a Google Developers en WeChat

¿Quieres navegar por el sitio web en ?

Has solicitado que la página aparezca en , pero tu idioma preferido en este sitio web es el .

¿Quieres cambiar tu preferencia de idioma y navegar por este sitio web en ? Si prefieres dejarlo para más tarde, usa el menú de idioma que se encuentra en la parte inferior de cada página web.

Para esta clase se necesita un nivel de API o superior

La documentación está oculta porque el nivel de API que has seleccionado para ella es . Cambia el nivel de API de la documentación en el selector situado encima del menú de navegación de la izquierda.

Para obtener más información sobre cómo especificar el nivel de API que requiere tu aplicación, lee el artículo Supporting Different Platform Versions (Compatibilidad con diferentes versiones de la plataforma).

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)