How to create external dependency gradle project?

I want to create an android project, that i want to use as a library. I want to use this library as any other gradle library, so my question is, how can i create a library project that i can use later as a dependency.

So my project for example: com.xyz.core

And i want to use this library project as a dependency in my android project like this: compile com.xyz.core

So i want to create a global library, that i can reach from everywhere, and i can use from gradle.

How can i do this?

Upvotes: 1

Views: 187

Answers (1)

yennsarah
yennsarah

Reputation: 5517

From Android Documentation:

To create a new module, select File > New > Module. Select the desire module type then click Next to enter the basic module settings:

  • Enter an Application Name. This name is used as the title of your application launcher icon when it is installed on a device. Enter a Module Name. This text is used as the name of the folder where your Java-based activity files are stored.
  • Enter a Package Name and Package Location. This class package namespace creates the initial package structure for your applications code files and is added as the package attribute in your application's Android manifest file. This manifest value serves as the unique identifier for your application app when you distribute it to users. The package name must follow the same rules as packages in the Java programming language.
  • ...

To make your Module "public" you can upload it on sites like Github and sync it to bintray (jcenter, maven... .

Upvotes: 1

Related Questions