Developers who want to develop and debug code on the desktop, natively yet be able to run it on multiple OSs without modification will want to know about libGDX. LibGDX is a Java* game development framework composed of a unified API that works across several platforms. It currently supports Linux*, Windows*, Android*, iOS*, Mac OS X*, and HTML5.
You can find the official documentation here.
To use libGDX, applications must be written in Java. If you have questions about using libGDX, a handy forum is available.
The first step is to set up your development environment. You can read about it here.
In addition to installing Eclipse*, Android SDK, JDK, and ADT plugin, you need the Gradle tooling for Eclipse (see Eclipse-Integration-Gradle project at https://marketplace.eclipse.org/content/gradle-integration-eclipse).
In Eclipse, go to Help > Install New Software:
Install all applications:
Next, create a libgdx project:
To install libGDX, download the gdx-setup.jar here.
After downloading and installing libGDX, you will see this window, allowing you to configure your project.
Fill out the form and click the “Generate” button. You are ready to import a project into your IDE.
In Eclipse you can import your project with the series of commands Import > Gradle > Gradle Project:
On the next dialog, click the Browse button and find the root of your project. Then click Build Model:
Eclipse will download different packages that are needed and build the project. If no errors occur, you will see:
Your project is ready for you to work on.
Since I only chose one OS in the project setup, my project contains only two packages: the FirstLibGDX-core package is for the logic of your game. And the FirstLibGDX-android package contains the code for Android activities.