Importing Module in Android Studio
Steps to import Module in Android Studio 3.3 and lower.
- Go to File >> New >> Import Module...
- Select the source directory of the Module you want to import and click Finish.
- Open Project Structure and open Module Settings for your project.
- Open the Dependencies tab.
- Click the (+) icon and select Module Dependency. Select the module and click Ok.
- Open your
build.gradle
file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
Steps to import Module in Android Studio 3.4 and higher (See attached image).
- Go to File >> New >> Import Module...
- Select the source directory of the Module you want to import and click Finish.
- Open Project Structure Dialog (You can open the PSD by selecting File > Project Structure) and from the left panel click on Dependencies.
- Select the module from the Module(Middle) section In which you want to add module dependency.
- Click the (+) icon from the Declared Dependencies section and click Module Dependency.
- Select the module and click Ok.
- Open your
build.gradle
file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
To import an existing Java library to an android project. Do the following.
Then select your Java library.
- Click on
File
and selectImport Module option
. - Open of select your
ViewPagerIndicator
module from local. - add
compile project(path: ':ViewPagerIndicator')
in your gradle file.