2

I need to use this java source code to retrieve data from a public educational repository. How can I add this folder to my Android Studio project, and the project recognize it?

Every search I make in Google results in how to add .jar or .aar libraries. This is just a source folder with java classes.

Use of Android Studio is a must for this assignment.

Thanks.

Imacisco
  • 77
  • 1
  • 6
  • copy and paste the folder into `src/`? – Tim Dec 20 '17 at 13:14
  • Possible duplicate of [How to add a linked source folder in Android Studio?](https://stackoverflow.com/questions/18947314/how-to-add-a-linked-source-folder-in-android-studio) – Guillaume Barré Dec 20 '17 at 13:15

1 Answers1

1

You can add it via Gradle in the project with

dependencies { compile project(':Dependency') }.

Also add it to settings.gradle like this

include ':Dependency' project(':Dependency').projectDir = new File(settingsDir, '../Dependency')

Read more here.

  • 1
    Thanks. i tried this, and other similar answers, but the project seems to be unable to resolve the dependency. I created a directory at the root of the project called libraries, copied and pasted xaoi-master in that directory, added the [code](include ':libraries:xaoi-master') in settings.gradle, and the [code]dependencies { compile project('libraries:xoai-master')} in build.gradle, with no successful sync – Imacisco Dec 20 '17 at 15:47