Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android library vs. external jar

Tags:

android

I have an external jar that I can use in my Android application, I just reference it as an external jar from my application. Is there any benefit in creating an Android library project with this external jar for Android applications to use, or is this pretty much the same as referencing the external jar?

like image 673
Mete Atamel Avatar asked Aug 31 '10 07:08

Mete Atamel


People also ask

What is the difference between jar and library?

A JAR serves the same function an an Assembly in the C#/. net world. It's a collection of java classes, a manifest, and optionally other resources, such as properties files. A library is a more abstract concept, in java, a library is usually packaged as a JAR (Java ARchive), or a collection of JARs.

What is the difference between AAR and jar?

Unlike JAR files, AAR files offer the following functionality for Android applications: AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.

What are Android libraries?

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.


1 Answers

Making a library project makes sense only in one case: if you want to share some application resources across all the apps (for example layouts, drawables, strings etc). If you just need some common java code there is no any difference between external jar and library project.

like image 146
Konstantin Burov Avatar answered Nov 15 '22 03:11

Konstantin Burov