Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Module in Android Studio

How can I import an external module (named ViewPagerIndicator) in Android Studio?

like image 418
user3395396 Avatar asked Jan 20 '17 13:01

user3395396


People also ask

How do I import library to Android?

To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

How do I import a module into gradle?

In Android Studio, Right-clicking on the folder to add as library. Editing the dependencies in the build. gradle file, adding: compile fileTree(dir: 'libs', include: '*. jar')}

What is a module in Android Studio?

Modules. A module is a collection of source files and build settings that allow you to divide your project into discrete units of functionality. Your project can have one or many modules, and one module may use another module as a dependency. You can independently build, test, and debug each module.


1 Answers

Steps to import Module in Android Studio 3.3 and lower.

  1. Go to Fill >> New >> Import Module...
  2. Select the source directory of the Module you want to import and click Finish.
  3. Open Project Structure and open Module Settings for your project.
  4. Open the Dependencies tab.
  5. Click the (+) icon and select Module Dependency. Select the module and click Ok.
  6. 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).

  1. Go to File >> New >> Import Module...
  2. Select the source directory of the Module you want to import and click Finish.
  3. Open Project Structure Dialog (You can open the PSD by selecting File > Project Structure) and from the left panel click on Dependencies.
  4. Select the module from the Module(Middle) section In which you want to add module dependency.
  5. Click the (+) icon from the Declared Dependencies section and click Module Dependency.
  6. Select the module and click Ok.
  7. Open your build.gradle file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
like image 110
Aman Shekhar Avatar answered Sep 18 '22 17:09

Aman Shekhar