The Architecture
Libgdx is a cross platform game development framework for Windows, Linux and Android. It is written in Java with some C/C++ mixed in for performance critical stuff like physics or audio processing. As a user you'll only be concerned with the Java side of things which conveniently wraps all the native code for your.
Libgdx allows you to write, test and debug your application on your desktop PC and use the same code on Android. It abstracts away the differences between a common Windows/Linux application and an Android application. The usual development cycle consists of staying on the desktop PC as much as possible while periodically checking whether your current code still works on Android.
Libgdx will do its best to provide you with a unified architecture to work on, guaranteeing the same behaviour on all platforms. While a noble goal it is sadly not 100% reachable. The main difference between the desktop and an Android device is that an Android device is usually a lot slower than your average desktop PC. This means that your application might run blazingly fast on the desktop but crawl on Android. Over the course of this tutorial we will encounter a lot of dos and don'ts which you should follow to guarantee good performance even on low-end Android devices.
As game developers we are in need of a couple of system components that allow us to create the game of our dreams:
- An application framework that handles the main loop and life cycle (creation, pausing, resuming, destruction) of our application.
- A graphics module that provides us with a way to draw things to the screen
- An audio module to playback music and sound effects
- An input module to receive user input from the mouse, keyboard, touch screen, accelerometer and so on and so forth.
- A file I/O module to read and write data like textures, maps or configuration files.