Introduction (preface)
Import an existing project to demonstrate the structure of the libgdx project to the development workflow.
Requirements)
Eclipse and Android SDK are required first. Visit Android SDK instructions for more details.
Download and import)
Download on Downloads page.Helloworld.zipSource code.
Choose File> Import...> General> existing projects into workspace in eclipse. On the import projects screen, click Select archive file. Click helloworld.zip.
Then find GDX-helloworld andGDX-helloworld-androidSelect projects and click Finish.
Running)
In the game code location, find our first projectGDX-helloworld. You can run it as an independent desktop application. Yes, it does not require simulators and Android phones. To run this project, you need
Right-click the GDX-helloworld folder and choose run as-> JAVA application. In the displayed dialog box, access the main class and select helloworld desktop. The Hello world desktop application will start:
The GDX-helloworld-android project adds some code on GDX-helloworld, allowing him to run on Android devices. If you see its source file directory, you will find it contains code. Because
This project involves everything from GDX-helloworld. Run this program (GDX-helloworld-android) and select Run as-> Android Application
At this point, the application will load and run in a compatible simulator (Virtual Device), or an Android device connected to the computer.
Going forward (next step)
Because the android simulator in the test game is too slow, running the game can simplify the development process as a desktop application.
Developers avoid loading the game to a device every time they want to preview
In addition, development teams and designers can test and share their changes more quickly.
You can try to make some changes in GDX-helloworld and run it as a desktop application. When you see the changes made when running the GDX-helloworld-android project on Android, you will be satisfied with the final result. A better development process is the advantage of libgdx. For details about the different features of libgdx, refer to the upcomming tutorial.