Search code examples
javaandroideclipseandroid-studioandroid-library

Difference between Android library and Java library in Android Studio


enter image description here

When creating a new module in Android Studio we can choose between an Android Library and a Java Library. From tinkering with both, my understanding is that an Android Library has access to Android resources while a Java Library only has access to Java resources.

So creating a Java Library in Android Studio is like creating a new library in an ordinary Java IDE such as Eclipse. (It even seems to give us access to RMI, which Android does not support.)

Is this correct, are there any other differences one should be aware of?


Solution

  • Like the small description of each project type says, a Android Library is just another Android Application project,often referred to as Module.And Java Library is another word for a java project.The only difference between a module and a project is the complexity. Take a look at this nice description from intellij about modules and how they differ from :

    Module-based project structure

    This feature is ideal for complex projects, with multiple internal dependencies, and especially for J2EE projects. Module is a separate logical part of a project that incorporates your working sources, libraries, reference to target Java SDK, etc. It can be compiled, run or debugged as a standalone entity.

    enter image description here

    A project may consist of one or multiple modules. Modules may depend on each other. Modules and libraries can be easily shared among multiple projects.

    source

    This is also a good read.