-5

just like all of you, I've made MyFirst Instant App from AndroidInstantAppDemo, but what if I want to add more activities into my app?

I want to provide multiple links for them. Should I simply add all of those activities under app module and provide dependencies{... implementation project (":base") } in build.gradle. Along with that, adding the different path with same host address in .manifest file.

Or

Put all the activities under base module only.

If yes (2nd options), does that mean that we should transfer data from app module to base module, in order to add InstantApp functionality into our project.

I think I'm not very familiar with all three modules of them, and the PROJECT STRUCTURE just provided an overview of these modules. Can anyone help?

Daksh Gargas
  • 3,498
  • 2
  • 23
  • 37

1 Answers1

2

Basically both your Instant app module and application module depends on feature modules. As far as I know Instant app and application module does not contain any activities.

Out of all these feature modules there should be a baseFeature module. The feature modules should be less than 4mb in size. Now, when a linked is clicked for an Instant app, Google Play downloads base + feature1 apks and installs them in background. If you wants to travel between feature modules you can do that by using deep links.

A feature module can contain any number of activities but with the constraint that it's size should be less than 4 mb.

I will suggest not to put any activities in application module. Just make some feature modules and link them with a URL. The feature module works like a library generating an aar file for your installable app.

If you want to provide multiple links, maybe this can help - Here

Sandeep Chauhan
  • 117
  • 1
  • 9
  • I have a doubt, I'm working on a multi-feature non-AIA (Android Instant App) application and I want one of the feature to be an instant one. So do I simply perform the following steps? **1**. Convert my `app` module into `base`/feature` module. **2**. Create a new `app` module. **3**. Create an`instantApp` module **4**. Link all of them view `build.gradle` Is that it? – Daksh Gargas Jun 19 '17 at 05:20
  • Well, these are the ideal steps given in the Instant app documentation. – Sandeep Chauhan Jun 21 '17 at 14:45
  • Check out this codelab that demonstrates how to convert your non-AIA project into one that includes the instant app: https://codelabs.developers.google.com/codelabs/android-instant-apps/index.html#0 There are also some helpful sample apps for reference: https://developer.android.com/topic/instant-apps/samples.html – Julia K Jul 28 '17 at 22:39