I am confused about the difference between Library Module and App module. I did google it but I didn't quite find a clear difference. The Android studio docs goes about how you can convert app module into library module.
What is really the difference? When do you use what? It seems to me that both are essentially the same.
Thanks
An app module builds an app. A library module builds a 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.
So, for example, this Android Studio project contains a netsecurity/
library module, representing some code that can be used by zero, one, or many app modules. Specifically, the library helps with advanced SSL configurations (self-signed certificates, certificate pinning, etc.). The project also contains a demo/
app module, which creates an Android app that uses the netsecurity/
library module and demonstrates its use.
A Library is a collection of pre-built compiled code which you can use to extend your application's features. For example, you may need to show some graphics in your application. Instead of creating this from scratch, you may choose to use a pre-built library someone else has developed which will give you the features you need thus saving you some time.
A module is a small part of the application which can be tested and debugged on its own without needing the whole application. This is same for any programming language. Suppose you are building an app with Login feature. To test if the login feature works, you don't need the whole app. Thus the Login part is a module of your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With