I'm currently learning how to make mobile applications. I got sources from here and git and coded them on different projects, I found a way to make those things work but my main problem is how to merge those projects into 1 fully working application and use intent to call each applications out. I've tried importing those projects as modules but it seems so confusing. Thank you.
Asked
Active
Viewed 1,321 times
-1
-
Go look [here](https://stackoverflow.com/questions/33528400/how-to-combine-one-android-studio-project-into-another-android-studio-project) an other people have the same issue – Albanninou Jan 21 '18 at 22:38
1 Answers
1
You can't merge different projects as one application as it is. You need to make one project as application module (with apply plugin: 'com.android.application'
in the first line of its build.gradle
) and make the other project as library module (with apply plugin: 'com.android.library'
in the first line of its build.gradle
).
After that, you need to remove the app applicationId
line in the library module. Then you can try to call the Activity from the another project (which has been converted as library).

ישו אוהב אותך
- 28,609
- 11
- 78
- 96
-
my login module is my main activity so im going to call it from a library project? which of the two would land whenever i run my application? or should i make my login module into a login library? – flamingmarshmallow Jan 22 '18 at 10:51
-
whenever the user hits login (login module), i called my library module using intent Code: Intent accountsIntent = new Intent("health.care.com.healthcare"); accountsIntent.setPackage(this.getPackageName()); emptyInputEditText(); startActivity(accountsIntent); is this correct? thank you – flamingmarshmallow Jan 22 '18 at 10:54
-
The activity with `
-
Whenever you have include the library module, you can call the activity directly via intent. Something like `Intent accountsIntent = new Intent(context, AccountActivity.class); startActivity(accountsIntent)`. Do not use String for the class name. You will easily make a bug because of it. – ישו אוהב אותך Jan 23 '18 at 02:23