Veljko Dimic
Veljko Dimic

Reputation: 3

How can I add this module to my Android Studio project?

I've tried adding this millisecond chronometer widget to my android studio project using multiple different guides but none of them seemed to work for this specific file. This is my first time trying to add a module to an Android Studio project and I wasn't sure what to do. Also, how can I use it after I add it?

Upvotes: 0

Views: 70

Answers (1)

maciekjanusz
maciekjanusz

Reputation: 4775

This project doesn't have any external dependencies, it doesn't use resources. The simplest way would be to just copy the Chronometer.java file to your project.

If you really would like to build it as a module (kinda overkill), the way would be to import it as a gradle module: File -> New -> Import module. Point to a directory, then name the module, let's say "chronometer". You would need to add the following line to your global settings.gradle file (studio probably does that automatically):

include ':app', ':chronometer'

And in build.gradle of a module, where you want to use that new module, put:

dependencies {
    compile project(':chronometer')
}

And that would do, but as I say, it's reeeeally unnecessary.

Upvotes: 1

Related Questions