I've never really liked Eclipse and I normally code with Intellij IDEA, which, btw, has built-in support for Android development.
If you want to use AndEngine in Intellij IDEA, you first have to download the AndEngine source. So
git clone https://github.com/nicolasgramlich/AndEngine
Now create a new Android project in Intellij, call it whatever you want. Here's the important part:
go to Project Structure (CTRL + ALT + SHIFT + S or File -> Project Structure),
then go to Modules,
hit the green plus -> Import Module,
then select the AndEngine folder from where you downloaded it.
Hit OK, Next, Finish or whatever you may encounter in that particular dialog box, but don't close the Project Structure dialog yet!
Now you should have AndEngine in the Modules list in your dialog. Expand it (click the small arrow just before "AndEngine") and click the Android item that appeared. Make sure "Library Module" is ticked.
Now select the module of your project and in the Dependencies tab, hit the green plus on the far right. Select Module Dependency and from there, AndEngine. Hit OK.
On the left side, in Facets, make sure AndEngine is listed and (click it) "Library Module" is ticked.
Happy coding :)
PS: AndEngine has quite a few "extensions". If you want to run the AndEngine examples, you will need to repeat the steps above for all the dependencies.
LE: These steps also work for Rajawali, a great 3D OpenGL library for Android. :)
I have Android Studio v0.4. I'm trying to follow your steps but there seems to be some differences, for example under the Project Structure - > Modules there isn't a green plus button offering 'Import Module' option, there is only a grey button offering 'New Module' option, and this doesn't seem to work for me. Would you be able to update the instructions, thanks.
ReplyDeleteHey, Alex. I'm looking right now at the Project Structure -> Modules screen and there seems to be a green plus button just like in IntelliJ. And I'm using Android Studio 0.4 on Linux. Not entirely sure why's that, but here's a discussion on the topic: http://stackoverflow.com/questions/19898456/cant-find-import-module-option-in-project-structure-android-studio-0-3-4-0-3
Deletethank you mate !
ReplyDelete