Question: I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in a Windows OS, as mentioned [here](http://blog.glassdiary.com/post/67134169807/how-to-share-android-archive-library-aar-across):

> 
> First, you have to realize that the Android platform does not allow application-level “shared libraries”. In the “traditional” programming language platforms, C, C++, Java, you name it, we have this mechanism of sharing runtime libraries. (E.g., DLL on Windows, DSO on Unix, Jar on JVM, etc.). On Android, however, you cannot do that, unless you are Google or a handset manufacturer (See Footnote 1 below). As an application developer, this can be a fundamental limitation. “Sharing” or “reusing” codes, both at build time and run time, is a very important part of software engineering practice. This is rather hard (not impossible, just harder) on Android because of the aforementioned limitation.
> 
> 
> 

However, I have some doubts around this concept. I mean, when should a developer be interested including *aar* dependencies in its application? Are this dependencies tightened to some SDK minimum version?

For example, in one project I access a COM port, which I use [NDK precompiled](https://developer.android.com/tools/sdk/ndk/index.html) *.so* libraries for. Do I have to create an aar if I want to share this utility?

Answer: 
`AAR` files are more similar to `Jar`s than to `Dll`s for the following reason:

> 
> `Dll`s can be shared across applications where as `AAR`s and jars are
>  packaged in with your app.
> 
> 
> 

`AAR`s vs `Jar`s:

> 
> The main difference between a `Jar` and a `AAR` is that `AAR`s include
>  resources such as `layouts, drawables` etc. This makes it a lot easier
>  to create self-contained visual components. For example if you have
>  multiple apps that use the same login screen, with `Jar`s you could
>  share classes but not the layout, styles, etc., you still had to
>  duplicate them. With `AAR`s everything is bundled in one neat package.
> 
> 
> 

In conclusion, `AAR`s are a big step in the right direction.

**Note:**  
 Similar attempts were made with `apk-lib`s but they are now obsolete as `AAR`s are much better.
**JAR vs AAR**

`JAR` – Java Archive. Contains `.class`, java resources

`AAR` – Android Archive. Contains `classes.jar`, and other Android related files like AndroidManifest.xml, R.txt, proguard.txt, res folder(layout, values, drawable) and others.

Android works with both files `jar` and `aar`. As a library developer usually `aar` is used for sharing Android resources, otherwise - `jar` like more lightweight and common way of distributing an artefact.

Since `aar` contains `jar` you can use it[[About]](https://stackoverflow.com/a/56837353/4770877)

Difference:

* [[transitive dependenct]](https://stackoverflow.com/a/61186642/4770877)