Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java library vs android library

what are the differences between Java library and android library and what advantages/disadvantages has each?

like image 724
Buda Gavril Avatar asked Apr 11 '11 13:04

Buda Gavril


People also ask

Can I use Java library in Android?

To use a Java library (JAR file) inside your Android project, you can simple copy the JAR file into the folder called libs in your application. *. jar files in this folder are included into the compile classpath via the default build.

Is Android and Java the same?

What is the difference between Android and Java? Java is a programming language, while Android is a mobile phone platform. Android development is java-based (most of the times), because a large portion of Java libraries is supported in Android.

What is an Android library?

An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest.

What is the difference between AAR and jar?

The main difference is aar is splitted inside android to jar. If your app will be used only in user app only in android studio then aar is preferred. If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.


1 Answers

You can include standard Java .jar file libraries in an Android app. They are translated into Dalvik format at .apk build time.

There is an Android Library system which allows the use of shared resources such as layouts and localized strings. As that has more restrictions that regular Java libraries I'd only recommend this method if you actually need to share resources.

http://developer.android.com/guide/developing/projects/projects-eclipse.html

like image 65
Jim Blackler Avatar answered Oct 15 '22 08:10

Jim Blackler