In Android systems or development enviroments, what are the differences between AAR, JAR, DEX, and APK files? What is the purpose of each one?
AFAIK, JAR are just like a
JAR are just like a collection of .class files (like in Java).
That is because it is a Java JAR.
AAR are JAR files + resources
Correct.
But what's its usage case? To be used to distribute development libraries for Android?
Correct.
APK seems to be similar to packages like .deb or .rpm. Is it the only way to install applications on Android?
Generally speaking, yes.
What about DEX files?
DEX files contain the cross-compiled Dalvik bytecodes representing the application code. Developers write Java, but Android runs Dalvik bytecodes. In the APK, you will find a DEX file representing those bytecodes.
Moreveor, when distributing .so (i.e. native code) files for Android, what's the best way to do it?
I do not know what you mean by "distributing".
If you mean "distributing an app", your .so
files will be in the APK.
If you mean "distributing as a library for other developers", use an AAR or just an Android project in source form.