Mehdi Haghgoo
Mehdi Haghgoo

Reputation: 3484

Can I Include an application within another

I have the source code for two applications. One is a legacy official app with package name com.officialaz.app and one is the new application I have created with package name com.media.mediaplayer. The manager wants the two applications integrated so that the second app becomes part of the first one. Given the fact that both applications have manifests and activities of their own, is this possible to achieve? Or should I use intents to interact between the two applications (installed separately on the device)? One thing that I tried was importing the source code for the 2nd app as a module within the 1st app. Then near the hammer icon I see two apps I can select from the drop-down menu. Running the app does not work and it says that e.g. apk_6.apk is defined multiple times. What do you suggest?

Upvotes: 1

Views: 324

Answers (1)

David
David

Reputation: 16277

The simplest way to implement this is to use "Implicit intent".

  • In your legacy app, in the manifest add some custom url: enter image description here

  • In your new app, add a button click event handler, and link it to open the custom url: Custom Protocol Url

  • You can also pass some data to and from these two apps. A relevant, but not exactly the same tutorial can be found here.

  • Google also has a formal tutorial on this topic.

Upvotes: 2

Related Questions