loading

This tutorial assumes you already have Android Studio installed and working, but need to know how to use Andengine in your project.

Andengine is an open source game engine for Android. It is documentation-poor, but feature rich. Unfortunately it was designed to be used with Eclipse. Since google has deprecated support for the ADT eclipse plugin, many people have been wanting to import it into the new gradle based android studio. That isn't as easy as it sounds. After a lot of googling I came up with this. I'm posting it here in the hopes that it will be helpful.

Step 1: Download Andengine From Github

Go to

https://github.com/nicolasgramlich/AndEngine

Now switch to the branch GLES2-Anchorcenter.

Click "Download as zip" and extract the files somewhere.

Step 2: Create a New Android Studio Project and Add Module

Open your copy of android studio and create a new project. Use the empty activity option. Name the project as you like.

Now 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

Click next and select "add no activity"

See the screenshot above.

Step 3: Copying the Files

Now navigate to the folder where you downloaded Andengine. You need to go into src/org/andengine. Copy all of the files to you Android Studio projects folder src/main/java/org/andengine. See screenshot above.

Step 4: Copy the Manifest File

Now enter the folder you downloaded Andengine to. Copy the file "AndroidManifest.xml" and paste it into your project AndEngine/src/main. There will already be a file there, replace it.

Step 5: Add the Module to Your Project

Now it is time to add the module to your project. Select File-> Project Structure -> app -> Dependencies or hit Ctrl-alt-shift-s.

Click the “+” button at the top right 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 can now use AndEngine in your project.

<p>after all the steps in my project any errors , namely : Studio complains about missing classes http</p><p>What i must done?</p>
<p>i have the same problem :(</p><p>please somebody write EXACTLY, which files to which subfolder have to copy!</p><p>i copied the files from the STEP 3 to here: Project-Directory\AndEngine\src\main\java\org\andengine\</p><p>and the manifest.xml (from the .zip file) to Project-Directory\AndEngine\src\main\</p><p>Am I wrong?</p>
<p>I have the same problem...any solution?</p>
<p>Change &quot;compileSdkVersion&quot; in your AndEngine buid.gradle file to 22.</p><p>Apache packages were removed in SDK 23!</p><p>If you want to use SDK that is bigger than 22 just delete code related to apache </p><p>packages.</p>
<p>or you could add legacy jar</p><p>android { </p><p>compileSdkVersion 23 </p><p>buildToolsVersion &quot;23.0.0&quot; </p><p>useLibrary 'org.apache.http.legacy' </p><p>... </p><p>} </p>
<p>Thank youuuuu!!! :******* &lt;3 </p>
<p>Thanks A'lot Man </p>

About This Instructable

16,148views

13favorites

License:

More by braumeistersmith:Create an Andengine App in Android Studio Using the LM335 Temperature Sensor Arduino from Android over Bluetooth 
Add instructable to: