8

I'm working on a project where I've to integrate two Android apps into a single app, using Android Studio IDE.

For example, I have App_A and App_B; these two Android apps are from two separate vendors. Now I've to integrate App_B inside App_A. Hence there would be a single AndroidManifest.xml file (of App_A) with MainActivity (launcher) and a single apk would be generated.

So far, I've imported App_B as a module inside App_A. Now, I can run each module separately. But I've to create a single apk file comprising of two modules.

I've searched in different Android forums in the Internet and so far I've not found any suitable solution.

First of all, I want to know whether it's possible to integrate two Android apps from two different vendors into a single Android app. If it's possible then please provide a solution to this issue. Also it would be a great help if you can send me your suggestions, ideas or any links regarding this issue.

Thanks & regards,

Debu

Debu
  • 83
  • 1
  • 1
  • 5
  • 1
    `I want to know whether it's possible to integrate two Android apps from two different vendors into a single Android app.` **No**, it's not. Unless these apps aren't open source and you can modify their sources to mix them into one. Or unless you want to turn yourself into a **pirate** and decompile them yourself. – Phantômaxx May 08 '15 at 08:14
  • Yes, you should. It will probably require some time to learn the logic of both apps (`analyzing is always harder than creating`, since each of us reasons in a different way). – Phantômaxx May 08 '15 at 09:58
  • @Debu see my answer below, it should solve your requirement, let me know if any issues faced! – Asif Mujteba May 08 '15 at 10:01
  • Did any solution work for you ? @Debu I am searching a way to do the same thing. Can you please suggest ? – Ekta Jayswal Sep 03 '15 at 10:52

3 Answers3

3

Yes you can do that:

  1. Import the third party app's source code as a separate library module.
  2. Modify the dependencies section of your Main module's build.gradle file to include the third party module as a dependency like this:

    compile project(':your_module_name_here')

Asif Mujteba
  • 4,596
  • 2
  • 22
  • 38
  • Hi Asif, thanks for your reply. I also thought that I can create a separate library module. I would try this. – Debu May 08 '15 at 09:59
  • Did this solution work for you ? @Debu I am searching a way to do the same thing. Can you please suggest ? – Ekta Jayswal Sep 03 '15 at 10:52
1

You can launch other apps activities from your main app. It's the same as integrating facebook, you declare com.facebook.LoginActivity in your manifest. In Project_A manifest file declare activity from Project_B. FB eg:

 <activity
        android:hardwareAccelerated="false"
        android:name="com.facebook.LoginActivity"
        android:theme="@style/Vinted.NoActionBar"
        android:screenOrientation="portrait"/>

Also don't forget to include Project_B in gradle, FB eg:

compile('com.facebook.android:facebook-android-sdk:3.23.1')
Tadas Valaitis
  • 870
  • 10
  • 11
1

If you just want to integrate App_A and App_B, just as your case, you could do like this: select App_A and right-click--->Open Module Settings--->Modules--->App_A--->Dependencies--->Plus--->Module Dependency--->select App_B and then OK. But if you want export only one APK from the two modules, I am afraid you have to add activity&service&broadcast thing of AndroidManifest.xml of App_B into that of App_A manully. and delete AndroidManifest.xml of App_B.

SilentKnight
  • 13,761
  • 19
  • 49
  • 78
  • Hi SilentKnight, thanks for your reply. I'll try this approach. – Debu May 08 '15 at 10:20
  • @Abhishek - As Asif had mentioned above, the solution to this problem is to make App_B as a lib module inside App_A (hence, I had accepted that answer too). – Debu Dec 27 '19 at 15:13