官术网_书友最值得收藏!

Adding as a module

You can also add a library in Android Studio by adding it as a module. To add the module:

  1. First, place the library code in any folder of your choice
  2. Then, you need to Import the library as a module in your app. The figure below shows the steps to add the library as a Module:

This will open a new window where you need to select the library that you have saved to the directory. When you have selected the directory, click on Done. This will import the external library into your project.
As an example, I have added the module crop image to my project, which appears in my project folder.

Next, we need to add the module to the app's dependency list. To do this, right click on the module that has been added and click on the Open Module Settings option:

It will open a new window with your app module and library module in the list. Choose you app module, and then select the dependency list.

Next, click on the plus icon which will open another dialog with the module name. Select it and click OK:

This will build the Gradle and add the module to the build.gradle, and it will be seen as a compiled project here:

Note that Core, UI and Util sub projects can also have their own build.gradle file, depending on their specific needs. Alternatively, you can also define the dependencies of a project in the root build.gradle file, as discussed in the preceding section. In this case, we won't be focusing on these points.

主站蜘蛛池模板: 北京市| 吉木萨尔县| 阳原县| 安泽县| 绥宁县| 遂昌县| 拜城县| 门头沟区| 怀宁县| 陇西县| 宜章县| 临猗县| 赤水市| 开封县| 扶绥县| 大埔县| 文化| 宿松县| 睢宁县| 秭归县| 深泽县| 海伦市| 赫章县| 靖边县| 西畴县| 盱眙县| 钦州市| 明星| 嘉义县| 花莲县| 都昌县| 登封市| 公安县| 体育| 宁蒗| 肥西县| 沈阳市| 鄂尔多斯市| 阜新市| 拉孜县| 肥东县|