Add AndEngine as a library for my project in Android Studio

1

I'm trying to import the AndEngine project by Github and then add the AndEngine Physics Box2D extension.

I'm doing the steps:

  • I created my project
  • I installed Git and added the path C: \ Program Files \ Git \ bin \ git.exe in the settings
  • In VCS - > Checkout from Version Control - > Git, I added the URL of the projects AndEngine.git and AndEnginePhysicsBox2DExtension.git and clicked on "clone".
  • The process is successful but when it finishes, it asks if I want to add a new project with the name AndEngine and another with the name AndEnginePhysicsBox2DExtension .

    Anyway, directories are created outside of my project.

    My question is how do I add AndEngine as library in my Android Studio project.

    An example of the problem is that it does not recognize the SimpleBaseGameActivity and EngineOptions of my code.

    My Code

    import android.transition.Scene;
    
    /**
    * Created by lmontanhine on 20/1/2015.
    */
    public class GameActivity extends SimpleBaseGameActivity {
    
    @Override
    public EngineOptions onCreateEngineOptions() {
        // TODO Auto-generated method stub
        return null;
    }
    
    @Override
    protected void onCreateResources() {
        // TODO Auto-generated method stub
    
    }
    
    @Override
    protected Scene onCreateScene() {
        // TODO Auto-generated method stub
        return null;
    }
    }
    
        
    asked by anonymous 20.01.2015 / 16:19

    1 answer

    2

    Android Studio is based on GRADLE, that is, project is understood to be a cluster of modules. In your case you need to clone the Git projects and then import them as modules into your project.

    Once you have done this, you only need to add these new modules to the main project dependencies. : -)

        
    22.01.2015 / 19:36