7

I want to use HoloEverywhere (HE) Preferences AddOn with my live wallpaper project. The project is almost done, i just need it to look the same from android 2.3 to 4.4, so i went on and followed the guide to get HE from GitHub.

After the checkout and the successful test of the "Demo" module, i went back to my project, but i can only create a new module, not import one, and of i try to set the new project to the module's folder (library and addons in my case) Android Studio as me if i want to rewrite the module settings, if i do, it create the folder, but it will not compile and the import org.holoeverywhere will not work.

Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
Maxinne
  • 1,693
  • 2
  • 23
  • 47
  • https://github.com/Prototik/HoloEverywhere/wiki/Import-in-IDE#android-studio--intellij-idea – Gabriele Mariotti Dec 23 '13 at 15:21
  • @GabrieleMariotti Done it, got the demo working. Now i want to add it to my project. I can't find a way to import it to my project's library... Edit: To clarify, I'm on Android Studio 0.4.0 – Maxinne Dec 23 '13 at 15:51

3 Answers3

9

You can set external module in this way

In global setting.gradle file add this line

def projectDialogsDir = file('path_of_the_module')
def rootProjectDescriptor = settings.rootProject
settings.createProjectDescriptor(rootProjectDescriptor, 'yourModule', projectDialogsDir)
include(':yourModule')

Then in the build.gradle files of your app's module, you have just to add, under dependencies

dependencies {
  compile project(':yourModule')
}
Stefano
  • 3,127
  • 2
  • 27
  • 33
  • This is the answer to a more general question: how to import a project that is not an Android project but is simply a Java project? I looked for this for a long time and now I found it. – mneri Apr 01 '15 at 00:17
2

There isn't an import module command yet; you'll have to do it manually. The high-level overview is that you'll need to set up a build.gradle file for your library module, include the library module in your project's settings.gradle file, and add a dependency from your app to the library project (which you can do by hand or through the Project Structure UI).

To set up the library module and include it, you can either author the relevant changes from scratch, or you can go through the Add Module UI to create a blank module, and then copy the files from the library into the template. If you want instructions on how to do the latter to include the Facebook library, see this: using facebook sdk in android studio and modify as necessary for holoeverywhere.

Community
  • 1
  • 1
Scott Barta
  • 79,344
  • 24
  • 180
  • 163
1

Importing modules works correctly in Android Studio 0.5.5

Helin Wang
  • 4,002
  • 1
  • 30
  • 34