Android Instant Apps: Step-by-Step Guide on How to Create One

Google’s new concept of Android Instant Apps is a revolution for the mobile app world, making it possible to offer its users small applications which work even when they are offline. While they are still not available for everybody since only a few developers currently have access to this technology, Google has prepared an SDK containing everything needed to create an instant app, and which is available to all Android developers.

 

Your Guide To Creating An Android Instant App

Here’s a “step-by-step” guide for creating an Android instant app.

 

1. Requirements

Before anything else, you must meet the requirements to be able to create your instant app:

  • Your Android application should already have all it’s required features (and more) working on a mobile device or emulator. 
  • Your source code should be available for editing by any developer who wants to work on it, independently of its final destination.
  • The source code should be available for editing by any developer who wants to work on it, even if its final destination is not the mobile device where it will be used.

 

2. Create an Instant App Module

The first thing you need to do is create an instant app module. To do this, follow these steps:

Select File > New > New Module from the Android Studio’s main menu. Choose “Instant App” as module type and click Next. Check if your sources are included in the Instant App module and select Finish.

 

3. Decide on a Minimum SDK

Every instant app module will have a minimum supported version of Android that the project requires to run. Unlike regular Android applications, where you can choose any minimum compatible versions for your application, with Instant Apps Google recommends keeping the lowest possible versions for your instant app available on Google Play. The reason for this is that from now on, all the modules of your application will be able to work offline for the most part.

 

4. Configure Your Instant App Module Dependencies

During this step, Android Studio will ask you if you want to add new dependencies in your project or not. The recommended answer is “Yes” because adding dependencies in your instant app module is one of the ways to make it available on Google Play.

 

5. Configure Your Default Activity

After configuring your instant app dependencies, you will see that Android Studio has added a new layout called activity_main into the “res/layout” folder of your instant app module (notice that this layout is using “ComplexAppTheme”). This layout represents the activity that will be started when a user launches your instant app. The only thing you have to do is add a button into this layout which starts your default activity, in our case the Hello World! activity.

 

6. Configure Your Base Module Dependencies

As you may already know from Google’s documentation on this subject, for the Instant App feature to work, it must be able to reach all the features in your application. To achieve this goal, you need to tell Google Play Store that when a user wants to use your instant app he is also interested in using its base module (your “base” module). This is done by adding your instant app’s dependency on your base module to your AndroidManifest.xml file, just like you would with any other application or module dependency. Notice that this is not an optional step and it’s important to do if you want your instant app to work correctly on Google Play Store.

 

7. Test Your Instant App

You can now test your instant app by building the project (menu: Build > Rebuild Project) and then selecting the build variant called “Instant App” (menu: Build > Select Build Variant). Notice that you can switch between normal APKs and Instant Apps anytime by using the same build variant menu.

 

8. Configure Your Instant App’s Metadata

Before uploading your instant app to Google Play Store, you have to provide it with metadata. This is done using an “Instant App Configuration” file that lives inside the “app” folder of your instant app module. Notice that this configuration file will be copied into all APKs that are generated for your instant app module, so expect this process to take some time if your application has many configurations.

To configure metadata for your instant app, open your project-level build.gradle file and include the following snippet:

apply plugin: ‘com.android.instantapp’

 

9. Test Your Instant App on a Device or Emulator

Now you need to test your instant app running on an Android device or emulator in order to know if everything is working properly. To do so, you have to install your instant app on a test device or emulator that has the Play Store application installed. After doing this, just open Google Play Store and search for your application’s name or click on the “Apps” menu item in order to see all applications available for installation.

 

10. Publish Your Instant App on Google Play Store

To publish your instant app on Google Play Store you have to create a new release in the Developer Console (menu: “Release Management > Instant Apps”). After doing this, go back to Android Studio and add some metadata values called “Discovery Badge” and “Deep Link URL” into your project-level build.gradle file, just like it is explained here. Notice that the value of your “Deep Link URL” has to point to your instant app’s default activity. After publishing your new release on Google Play Store, you may want to test this release locally before uploading it to Production. To do so you have to download the APK corresponding to your “app release” and then test your installation.

As you can see, creating an instant app is not a difficult task once you know how to do it and we hope this guide has helped you get started with the Instant Apps feature on Google Play Store. However, if developing your own Android Instant App does not seem like an attractive option to you, you can always find Android App Development Agencies to take on your project.

 

Current Status of Android Instant Apps in 2021

As you may know, the Android Instant Apps feature has been out on Google Play Store since June 2016 and it is already used by many companies. In fact, Google Play services for Instant Apps give users the option to experiment with the latest games right on the platform, without having to download them. They simply hit the “try now” button instead of “install.” 

Due to the Instant Apps technology being young, most of its features have not yet been documented in a single place. However, this information gap will be closing soon as there are some courses related to instant apps being prepared by Udacity and Google itself.

As they say, it is the early bird that catches the worm so we recommend you to start learning about Android Instant Apps as soon as possible if you want to be among the developers who are already using this technology.

Sunvera Software develops next-level software applications from start-to-finish. We are a premier software and mobile app development agency specializing in healthcare mobile app development, custom mobile app development, telehealth software, sales dashboards, custom mobile app development services, retail software development, supply-chain software, ecommerce, shopify, web design, iBeacon apps, security solutions and unified access software.

We are proud partners with Amazon AWS, Microsoft Azure and Google Cloud.

Schedule a free 30-minute call with us to discuss your business, or you can give us a call at (949) 284-6300.