How to Combine One Android Studio Project into Another Android Studio Project

How to combine one android studio project into another android studio project

You cannot have two "projects" as a single project in Android Studio.

Convert one (or both) project into libraries. Then create a "shell" project to build each app. The shell project is basically empty, or it may have build specific value overrides. The advantage here is that you can modify the library and changes will be immediately reflected in both/all versions. The drawback is that you will have to fix any issues in all projects that result from any change to any library. But you can then create the "combined" project in a similar manner.

After you convert one or both to a library you can create an aar file. This gives you the option to then include that aar as a gradle dependency. Be careful to remember that you will need to re-build the aar every time you modify that project - so if you have an indication as to which is the more stable codebase, go with that for the aar. This gives you the ability to "version control" the main project dependency so that you can make changes to one project without impacting the stability of the other.

Additionally, you can write scripts and use tools like Bamboo or Jenkins to do real-time updates to the aar - but that is like using a "snapshot" dependency. When you change the aar it may compile, but it may break the build of the second project without you knowing it until you do a build on that project. (And yes, you can include a build on that project as a part of the Bamboo or Jenkins script, but it isn't easy.)

There may be other alternatives, but these seem to offer enough options to produce a wide variety of build options.

How can i merge/combine multiple projects into one in android studio?

Found a solution to my problem:
first of all make sure that build.gradle of your apps in the projects you want to combine has the same information(sdk version etc.. and sync after changing), then just copy the necessary files(.java and .xml from project B to A) and make sure to change the package name starting with com. in the java files of project B to the same package name of the project A, lastly add the activities of the new java files added in the manifest.
That worked for me, hope it does for you too!

How to combine two android studio project and use it?

Have you imported the library package into your code?

Try adding import org.proninyaroslav.libretorrent; at the top of your class.

Merging two android studio projects from github

I Found out that this method was right, It is elegant and works.
My problem was that i had to add a dependency that was in Termux-api and that Termux-api wasnt able to find its resources.

In order to solve this I copied and pasted all the resources from Termux-api to Termux-app and I added the dependency:

implementation 'com.android.support:design:27.1.1'

that was supposed to be called from Termux-api.



Related Topics



Leave a reply



Submit