Android Archive Library (aar) vs standard jar
AAR
files are more similar to Jar
s than to Dll
s for the following reason:
Dll
s can be shared across applications where asAAR
s and jars are
packaged in with your app.
AAR
s vs Jar
s:
The main difference between a
Jar
and aAAR
is thatAAR
s include
resources such aslayouts, 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, withJar
s you could
share classes but not the layout, styles, etc., you still had to
duplicate them. WithAAR
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.
Difference between AAR, JAR, DEX, APK in Android
JAR (Java Archive)
JAR is a package file format designed for distribution of Java application on its platform. It contains compiled Java class files + some more files like MANIFEST. Basically it is just an ZIP archive with some restrictions.
DEX (Dalvik Executable)
DEX is binary file format, so it is compiled. We could say, that .dex file is for DVM (Dalvik Virtual Machine) something like .class files for JVM.
DEX file format is really generated from java CLASS files by dex compiler from Android SDK. This compiler translates JVM bytecode to DVM bytecode and put all class files to one dex file.
APK (Android Application Package)
APK is file format designed for distributing Android application on its platform. It has some similarities with JAR format. Again it is simply just a ZIP archive, but APK files have pre-defined specific structure. For example, it always must contains file named AndroidManifest.xml and many more. Also this package aggregates compiled classes in dex format.
AAR
AAR is the binary distribution of an Android Library Project. It has similar structure as APK.
Related Topics
Getresourceasstream() Is Always Returning Null
How and Where Are Annotations Used in Java
Is It Really Impossible to Protect Android Apps from Reverse Engineering
Duplicated Entries in Listview
How to Change a Bitmap's Opacity
How to Use Interceptor to Add Headers in Retrofit 2.0
How to Avoid Garbage Collection Delays in Java Games? (Best Practices)
Ksoap2 Org.Xmlpull.V1.Xmlpullparserexception Expected Start_Tag Error
How to Implement Enum with Generics
How to Limit the Number of Characters in Jtextfield
Differencebetween Unidirectional and Bidirectional JPA and Hibernate Associations
Prevent Android Activity Dialog from Closing on Outside Touch
Understand Arraylist Indexoutofboundsexception in Android