Add Andengine as a library to my project in Android Studio

Asked

Viewed 184 times

1

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

I’m doing the steps:

  1. I created my project
  2. I installed Git and added the C: Program Files path Git bin git.exe in the settings
  3. In VCS -> Checkout from Version Control -> Git, I added the project URL AndEngine.gitand AndEnginePhysicsBox2DExtension.git and clicked on "clone".

The process is carried out successfully but when it ends, 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 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;
}
}

1 answer

2


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

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

  • Oops, got it. It would be similar to importing the sdk from Facebook, for example. I’ll try to do it that way and if it works out, I’ll let you know. Thanks @Felipe Bonezi

  • That’s right! :-)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.