Tag Archives: Google Play Instant

Google Play Instant feature plugin deprecation

Posted by Miguel Montemayor and Diana García Ríos

As of Android Gradle plugin 3.4.0 (included in Android Studio 3.4), we are starting the deprecation process of the feature plugin (com.android.feature) and instant app plugin (com.android.instantapp) as a way to build your instant app. When building your app, you will receive a warning flagging com.android.feature as deprecated. If you have an existing instant app built with the feature plugin, migrate your existing app to an instant-enabled app bundle as soon as possible.

What is changing?

Last year, we introduced Android App Bundles—a new way to build and publish your Android apps. App bundles simplify delivering optimized APKs, including instant delivery, by unifying uploads into a single artifact. Google Play handles distribution by serving the correct APKs to your instant and installed app users—this is called Dynamic Delivery. To learn more about app bundles, visit the documentation site.

Dynamic Delivery is based on the idea of shipping dynamic features (com.android.dynamic-feature) to app users when they need them and only if they need them. There are currently three delivery types, based on the different values you will give the dist:module tag attributes on the dynamic feature module’s manifest file:

    <dist:module
       dist:instant="..."
       dist:onDemand="..."
       ...
    </dist:module>
dist:instant="false" dist:instant="true"
dist:onDemand="false" Dynamic feature delivered at install time Dynamic feature delivered instantly and at install time
dist:onDemand="true" Dynamic feature delivered on demand (beta) N/A

By migrating your instant app to an instant-enabled app bundle with dynamic features, you will be ready to leverage the full power of this new paradigm and you will be able to simplify your app’s modular design.

The migration

Previously, instant apps required creating a feature module that acted as the base module for your app. This base feature module contained the shared code and resources for both your instant and installed application. The rest of your codebase was comprised of:

  • multiple non-base feature modules, which contained the instant app entry points,
  • an application module, which contained the code and activities required only for your main installed application, and
  • an instant app module, which represented the instant app and mapped its dependencies.

With the new app bundle implementation, your base feature module takes the role as your app module (com.android.application), hosting the code and resources common to all features (instant and installed). You organize additional, modular features as one of three types of dynamic feature modules, based on when you want to deliver them to the user. The instant app module disappears, since the dist:instant attributes in the manifest are enough to identify which features will be included as part of the instant experience.

If you don’t have an instant experience added to your app and you’d like to create one, use Android Studio 3.3+ to create an instant-enabled app bundle.

Streamlining the developer experience for instant games

Posted by Vlad Zavidovych, Software Engineer; Artem Yudin, Software Engineer

Google Play Instant enables people to experience your game or app natively without having to go through a full installation process. Removing the friction of installing is a great way to increase engagement, conversions, and lifetime value of your users.

Today, we've made it easier to build instant games and apps by removing the URL requirement. Previously, in order to publish an instant game you had to create a web destination for it. The website also had to be connected to the instant game through intent filters and digital asset links verification.

Now, it is no longer required to add URL-based intent filters to your instant game. People will be able to access the instant experience through a 'Try Now' button in the Play Store or Play Games apps, via deep link API, and in the future through the app ads.

While being particularly helpful for games which often don't have a corresponding website, the new URL-less functionality is available to both game and app developers.

How to develop and publish an instant game without adding URL support

Game developers using Unity or the latest Cocos Creator can take advantage of URL-less instant games by simply leaving the URL fields blank in the setup process.

However, if you have your own game engine or have built your game from scratch in C++, check the AndroidManifest to make sure it has the following intent filter declaration:

<intent-filter>
   <action android:name="android.intent.action.MAIN" />
   <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Starting with Android Studio 3.2, you can create a new instant game, or convert your existing game, without associating a URL with it. In fact, this is now the default behavior. Here is a run through the process:

  1. First, make sure you're running Android Studio 3.2 or newer by either updating or downloading it here. Make sure to install Instant Apps Development SDK 1.3.0 or higher from Android SDK Manager.
  2. Then download a sample instant app from GitHub. In Android Studio, click File → New → Import Project… and import the downloaded "urlless" sample.
  3. Lastly, after gradle tasks are finished, click the green "Run" button with "instantapp" configuration.

You should see an instant game on your attached device. Instant runtime found and launched the entry point activity in your game with the ACTION_MAIN and CATEGORY_LAUNCHER intent filter.

Once you are ready to publish the sample instant game:

  1. Give your sample game a unique applicationId in app/build.gradle file by replacing existing applicationId - we don't want different applications with the same id.
  2. Generate signed APKs for both installable and instant version of our sample game.
    • In Android Studio, Build → Generate Signed Bundle / APK…
    • Choose APK for both "app" and "instantapp" modules.
  3. In the Play Console, create a new application, upload APK under "App Releases" tab, and then upload "instantapp-release.zip" under "Android Instant Apps" tab.
    • The installable app must be rolled out before the instant one.
  4. The rollout process may be familiar to most Android developers, but here's a step-by-step guide in case you run into any issues.

Once you publish your instant game, people can access it via a 'Try Now' button in Play Store within 24 hours or sooner. You can also send traffic to your instant game using the deep link API:

market://details?id=MY.PACKAGE.NAME&launch=true&referrer=myreferrer

MY.PACKAGE.NAME refers to applicationId that you have replaced in app/build.gradle file.

What's next?

With the launch of Android App Bundle we are excited to further simplify the developer experience for Google Play Instant. In the coming months we are making it possible to deliver your app's or game's dynamic features instantly from the same bundle as your installable app or game. Stay tuned!

Check out more information on Google Play Instant, or feel free to ask a question on Stack Overflow, or report an issue to our public tracker.

How useful did you find this blogpost?