I am really new into this topic, I have a simple project that is an android studio template with some modifications, the project is a simple application with sidebar menu, the android studio uses fragments for this case, now I want to use a module from another project (https://github.com/yamin8000/Gauge) inside one of the fragments (Home) of the app, I imported the module and did some gradle changes so the project has two modules now, one is the default "app" module, and the second is the "Gauge" module from the source project, but I absolutely have no clue how to perform it, shall I import the module like this: "import (project(":Gauge"))" or what? can someone explain me in simple language so I can understand it, tnx
The official documentation can be found here.
2
Answers
You have that
import (project(:Gauge))
– it’s not gonna work this way. Here is what you should do:build.gradle
and put this string to dependencies block, if it is not already there:implementation project(:Gauge)
Now, you can use classes and methods from Gauge module. Android Studio is smart enough and will provide you suggestions when you will start typing
Gauge
or something and will add needed imports automaticallyStep 1:
Locate your module from another project in
settings.gradle.kts
:Step 2: add this module as dependency in
app/build.gradle.kts
file: