I created a tutorial for this - How to add Andengine, Andengine Tile Map, Andengine PhysicsBox2D to Android Studio 0.8.9.
Here is the link, I hope everything works - https://docs.google.com/document/d/1zk2QjNiPvkj52G4qSVivEPrLfkCUVqmnCVH8TfsnER8/edit
ANDENGINE WITH ANDROID STUDIO 0.8.9
Note: I am using the AnchorCenter brach and TortoiseGit to get all the files.
- Download Andengine from github using TortoiseGit: https://github.com/nicolasgramlich/AndEngine
- After the dowload use TortoiseGit to switch to branch GLES2-AnchorCenter
- Create new project in Android Studio
- Create new module:
- Select File -> New Module -> Android Library
- Set Application name to AndEngine
- Set Module Name to AndEngine
- Set Package Name to org.andengine
- Set Minimum SDK 14
- Target SDK 19
- Compile with 19
- Theme None
- Keep clicking next until module is created (no difference what you pick)
- Enter the folder where you have downloaded Andengine, enter src/org/andengine and copy all the files inside.
- Paste the copied files into your new module in your project src/java/org.andengine. After pasting everything remove tha MainActivity that was created on default
- Enter the folder where you have downloaded Andengine, copy AndroidManifest and paste it into your new module (src/main)
- Add the module to the project:
- Select File-> Project Structure -> app-> Dependencies
- Click the “+” button and pick “Module Dependency”
- Select from the list your AndEngine Module
- Check your project gradle in app folder (build.gradle) and make sure you have a line like this under dependencies - compile project(':AndEngine')
You should now be able to use AndEngine in your project
ANDENGINE TMX TILED MAP EXTENSION WITH ANDROID STUDIO 0.8.9
Note: We do this the same way like with Andengine but we change a few things:
- Download AndengineTMX from github using TortoiseGit: https://github.com/nicolasgramlich/AndEngineTMXTiledMapExtension
- After the dowload use TortoiseGit to switch to branch GLES2-AnchorCenter
- Create new project in Android Studio
- Create new module:
- Select File -> New Module -> Android Library
- Set Application name to AndEngineTMXTiledMapExtension
- Set Module Name to AndEngineTMXTiledMapExtension
- Set Package Name to org.andengine.extension.tmx
- Set Minimum SDK 14
- Target SDK 19
- Compile with 19
- Theme None
- Keep clicking next until module is created (no difference what you pick)
- Enter the folder where you have downloaded AndengineTMX , enter src/org/andengine/extension/tmx and copy all the files inside.
- Paste the copied files into your new module in your project src/java/org.andengine.extension.tmx. After pasting everything remove tha MainActivity that was created on default
- Enter the folder where you have downloaded AndengineTMX, copy AndroidManifest and paste it into your new module (src/main)
- Add the module to the project:
- Select File-> Project Structure -> app-> Dependencies
- Click the “+” button and pick “Module Dependency”
- Select from the list your AndengineTMX Module
- Check your project gradle in app folder (build.gradle) and make sure you have a line like this under dependencies - compile project(':AndEngineTMXTiledMapExtension')
You should now be able to use AndEngineTMXTiledMapExtension in your project.
ANDENGINE PHYSICSBOX2D WITH ANDROID STUDIO 0.8.9
- Download this file - http://d-h.st/FyC
- Unzip the file
- You should have 2 jar files, copy them to your project app/libs
- Right click on andenginephysicsbox2dextension.jar and select “Add as library” (or something like this)
- Open your build.gradle in your app folder
- Under dependencies add compile files('lib/physicsbox2d_so_files.jar')
You should now be able to use PhysicsBox2D in your project.