Gaurav Tiwari
Gaurav Tiwari

Reputation: 11

Android : How to reuse Jars already included in an application

I have an application (Say A) which included some external jars.

I want to create a new application (Say B), In which I want to use same external jars(Included in A) without adding same again in project B.

Both Applications will always present in device I am using Android Studio.

Upvotes: 1

Views: 63

Answers (1)

Gino Mempin
Gino Mempin

Reputation: 29580

You could instead create a Library Module that will contain the common external jars to be used by different apps. Check out this Library Module link to the Android developer docs.

It states there that:

If you have source code and resources that are common to multiple Android projects, you can move them to a library module so that it is easier to maintain across applications and versions.

and:

A library module can include a JAR library

and:

A library module can depend on an external JAR library

So you can have a library module (say C) with the jar files, then add the library module as a dependency to both A and B.

Upvotes: 2

Related Questions