For quite some time I’ve dreamed of being able to use my Android devices for development. Until recently, this dream seemed like it would never become a reality (at least, to the extent I wanted). Then, I learned of a new app available on the Google Play store… AIDE – Android IDE, an on-device development environment for Android applications. I’m not sure if this is the first app of its kind or not, but it sure seems like it’s the best.

So, what exactly does AIDE do that makes it so awesome? Well, first of all, like any good code editor AIDE offers syntax highlighting. More interestingly though, it provides code completion, refactoring, and other helpful features that traditional IDEs offer (and most on-device code editors don’t). Lastly AIDE, makes it possible to compile and run your application directly without having to use a computer. This is, to me, the most exciting aspect of AIDE.

After working with LibGDX for the last year and a half, I naturally wanted to see if I could use AIDE to continue to do so. My first attempt ended rather quickly with a issue report to the developer of AIDE but they turned around a fix very quickly and I was back in business. Lo and behold, it works!

There are a couple ways to get this set up, but here I’ll describe an easy way to start a new project. I’ll assume we want to maintain the best practice 3+ project setup and, to make it easier, I will utilize the dev-guide demo project from the LibGDX SVN repository on Google Code.

I’m sure I don’t have to tell you this but, to be sure, ensure you have AIDE installed on your Android device (this will work the same on phones or tablets).

With that out of the way, the first step will be to acquire the dev-guide project. I did this right on my device using Open Android SVN but you can use any means you like (Box, Dropbox, and Google Drive are all fine choices, as is copying from your computer). I copied the dev-guide folder to the AppProjects folder that AIDE sets up on the sdcard but this isn’t strictly necessary as AIDE will open projects from anywhere you like. Next, start AIDE, then locate and open the my-gdx-game-android project. We’ll need to make some very minor modifications so it works in the AIDE environment. Open the .classpath file in the project root. Update the references to the shared project and gdx.jar so that they are relative to the project (as opposed to the workspace). At the time of writing, the icons included in the my-gdx-game-android project are broken so you’ll need to replace them. Creating a new project in AIDE is a fine method of acquiring new ic_launcher.png graphics. Just copy and replace the same in the my-gdx-game-android project. Now, we are ready to run the game to make sure everything is correctly setup. Simply choose the Run option from the Menu (or Action Bar if on Android 3.0+). It will take a few moments to compile and install. When it opens you should be met with a nice fuschia screen (You can thank Mario for that one).

Assuming all went well, you are now ready to build out the next big thing. You’re only limited by your own imagination. Well, that and your ability to be productive and creative on your Android device. Perhaps, I will do another post with some apps I’ve found useful in that regard.

So, to recap, the steps are:

  1. Acquire AIDE
  2. Acquire the dev-guide project from Google Code
  3. Update the classpath
  4. Replace the icons
  5. Run
  6. ???
  7. Profit

Update:: I’ve fixed the icons in the LibGDX SVN, so that step should no longer be required.

19 Responses to “LibGDX via AIDE”

  • sforzando says:

    What should the updated classpath look like?

  • admin says:

    Here’s what it looks like assuming you followed the steps above:

  • andr says:

    Very useful writeup!
    one thing that i need clarification on is where do I actually find the dev-guide folder?

  • andr says:

    I figured it out eventually, it ws my 1st time with svn. To run the other gdx demos do we need only to make similar classpath changes?

  • admin says:

    Most (maybe all) of the other demos link to the projects, rather than the jars. I’ve not been able to get AIDE to compile the whole shebang due to hitting memory limitations. If you were to swap out the project references for jar references then I think it would work the same.

  • kirot says:

    Have you built any of it at all prior to pushing it to Android? It might just be me, but AIDE isn’t trying to build anything outside of the Android project’s directory.

  • Ethel says:

    Wonderful! Thanks for posting this Nex. It is exactly what I needed to get off the ground with libgdx.

  • admin says:

    Sorry for the delayed reply… I did not build anything beyond the LibGDX jars prior to putting it on Android… AIDE will build any code that it has access to through the classpath, and it will dex the jars.

  • admin says:

    Glad to hear it!

  • glue says:

    I have tried this a whole bunch of times now, but it seems no matter what I do I keep getting an error saying the application has stopped unexpectedly and I have to force close.

    The same app works fine in eclipse running in the Android emulator and I can copy the apk file to my tablet and install it that way.

    Do you know of a way I can debug it in AIDE so that I can figure out why it’s crashing?

  • glue says:

    I finally worked out what the problem was! It turns out that subversion didn’t commit my armeabi-v7a and armeabi folders correctly so I was missing the .so files. As soon as I put them on my tablet in the right place everything started working correctly 🙂

  • Daniel says:

    I’m confused about what you mean by swapping out the project references for jar references. Very new at all this.

  • Andr says:

    Hello again. On my Xoom aide seema to be missing the options of activity and service and instead i have only ‘hello world’ ‘analog clock widgit’ and ‘tetris’

    Could this have something to do with doing the above tutorial or using svn?

    I’m pretty much a total noob and if i had the activity or service options before, i’m not sure how to get them back or revert to the previous settings :\

  • Andr says:

    Also, like daniel i’m not sure what you mean by swapping the jars. Lately i’ve been reading up on java but i’m not yet at the point where i’m fully fluent with the jargon

  • admin says:

    Ah, yes, this post is pretty old huh. I will revisit it later today, and maybe include a version of the Android version of the GdxSetup I made. That would probably make the whole thing easier for folks.

  • Umopepisdn says:

    Yes please!

  • pat says:

    I m interested using my tablet for developing with libgdx and AIDE, can everybody explain the procedure ?
    must we develop like a desktop project in eclipse ?

  • Jon says:

    Could you update the post again? I’m a bit lost with the whole classpath thing now that there are new examples.

  • alex says:

    сould not find dev guide demo project on git, could you place it somewhere where all can download it? and perhaps check if everything still works? thanks!