---
# System prepended metadata

title: Android Library Module
tags: [Android, Module]

---

# Android Library Module
###### tags: `Android` `Module`
[TOC]


## Why Use Modules?
Library modules are beneficial:

* When you're building multiple apps that use some of the same components, such as activities, services, or UI layouts.
* When you're building an app that exists in multiple APK variations, such as a free and paid version and you need the same core components in both.

## New Module
>**1. File > New > New Module**
**STEP 1**
![](https://i.imgur.com/LXlmgQn.png)[color=orange]

>**2. Select Module Type > Name > Finish**
**STEP 2**
![](https://i.imgur.com/sPXB3gs.png)[color=lightgreen]

>**3. Module will automatically be built in project folder**
**STEP 3**
![](https://i.imgur.com/y21HUFB.png)[color=lightblue]

>**4. Add any class you want to use for whole project**
**STEP 4**
![](https://i.imgur.com/155MOVx.png)[color=pink]

>**5. Add dependancy in build.gradle**
**STEP 5**
![](https://i.imgur.com/Rc8JSZl.png)[color=violet]

>**6. You will be able to get the class in the module from project.**
**STEP 6**
![](https://i.imgur.com/me2dfje.png)[color=gray]


## Delete Module
>**1. File > Project Structure > Modules**
![](https://i.imgur.com/L8SqPe9.png)[color=orange]

>**2. Deduct or add Modules > Apply > Ok**
![](https://i.imgur.com/ycTzU1U.png)[color=gray]


## APP VS Library
An app is what a user uses. The output of an app module is an APK, the package of an Android application.

A library is a collection of code that represents something that you want to use in multiple applications or otherwise want to keep in a separate "container" than the rest of the app code. The output of a library module is an AAR.