{"id":16621783,"url":"https://github.com/ravener/libgdx-termux","last_synced_at":"2025-10-29T21:31:48.746Z","repository":{"id":112630026,"uuid":"490795023","full_name":"ravener/libgdx-termux","owner":"ravener","description":"Starter template to use libGDX on Termux for Android Game Development","archived":false,"fork":false,"pushed_at":"2024-02-20T14:20:54.000Z","size":1016,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T05:04:39.207Z","etag":null,"topics":["android","game","java","termux"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ravener.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-10T17:21:37.000Z","updated_at":"2024-09-07T04:43:21.000Z","dependencies_parsed_at":"2023-06-10T03:00:21.655Z","dependency_job_id":null,"html_url":"https://github.com/ravener/libgdx-termux","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravener%2Flibgdx-termux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravener%2Flibgdx-termux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravener%2Flibgdx-termux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravener%2Flibgdx-termux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ravener","download_url":"https://codeload.github.com/ravener/libgdx-termux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238900126,"owners_count":19549456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","game","java","termux"],"created_at":"2024-10-12T02:48:27.020Z","updated_at":"2025-10-29T21:31:48.062Z","avatar_url":"https://github.com/ravener.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libGDX on Termux\nThis is a simple game written in Java using libGDX for Android with the intention to be built from Android using [Termux](https://termux.com)\n\n## Features\n- The game is based on the [libgdx wiki Drop example](https://libgdx.com/wiki/start/a-simple-game).\n- An ExceptionHandler is provided so crashes will write the stacktrace in a file within `/sdcard` this makes debugging easier when you don't have a computer to access logcat.\n- Game is fullscreen, including an additional value that also covers the notch area on Android 9+ (see `res/values-v28`)\n\n## Getting Started\nThe first step is to install a few tools we are gonna need\n\n```sh\n$ pkg install git ecj dx apksigner aapt unzip openjdk-17\n```\n\nThen clone this repository\n\n```sh\n$ git clone https://github.com/ravener/libgdx-termux\n$ cd libgdx-termux\n```\n\nFirst we need to fetch the gdx libraries, this only needs to be done once:\n\n```sh\n$ ./fetch.sh\n```\n\nThere are a few more tools you can use with libgdx (e.g Box2D) those are optional but you can edit the script and uncomment those lines if you desire those libraries for your project.\n\nNext generate a keystore so we can sign the apk, which is required otherwise Android won't allow us to install the apk.\n\n```\nkeytool -genkeypair -validity 365 -keystore game.keystore -keyalg RSA -keysize 2048\n```\n\nJust answer the questions and enter a password and you will be done.\n\nThe script assumes the filename to be `game.keystore` and the password to be `android`, edit the `build.sh` script to change as needed.\n\nNow that we have our keystore and all libraries we can proceed to the build:\n\n```sh\n$ ./build.sh\n```\n\nThis will build the apk and also copy it into `/sdcard/APKs` so you can easily install it from your file manager afterwards.\n\n### Bonus Optimization\nAt first the script compiles the `.jar` files from `./libs` everytime it's invoked, that wastes a lot of time and resources, we can compile them once, store the dex, and when building the main project just combine those cached dex files.\n\nIt is possible to optimize this, the script already looks for a special directory called `libs/dex/` which can store cached dex files and if it finds it, it will only include everything from there and ignore the raw jar files.\n\nA script has been provided to predex all the jar files for faster compilation, run that once:\n\n```sh\n$ ./predex.sh\n```\n\nNow you will see huge improvements in the compile time when using `build.sh`\n\n### Updating\nWhen updating the gdx libraries start by deleting the lib folders\n\n```sh\n$ rm -rf lib/ libs/\n```\n\n\u003e **Note:** If you added your own `.jar` files, take care to backup them or just manually delete the gdx libraries only.\n\nedit `fetch.sh` and bump any versions you want and run `./fetch.sh`\n\nalso run `./predex.sh` again for caching the dex files.\n\n## The Notch\nThe notch area or also known as the display cutout is supported by default in this template, the game will be full screen to cover the notch area.\n\nThis is meant to give you a starter on how to do it but you may not want it for your game, for example if you are heavily relying on the screen borders, on some phones with rounded edges the corners can hide some parts of what you render.\n\nIf you would like to disable it and let android render your screen below the notch area simply remove the `res/values-v28/styles.xml` file.\n\n## The Exception Handler\nThe template comes with an `ExceptionHandler.java` which is applied in `AndroidLauncher.java` it replaces the default uncaught exception handler to redirect the error to a text file within `/sdcard` this allows you to easily go to your file manager and open the log file to read the crash if you don't have access to a computer to view logcat.\n\nPlease note that in order for this to work, storage permissions are required.\n\nStarting from Android 6+ apps must request storage permissions via a dialog which has not been implemented here because it's just an example debugging tool and not really meant to be published in the end. So you will need to go to the app's settings and manually grant the `Storage` permission to make use of this.\n\n## Moving Forward\nThis project is supposed to act like a starter template to get you running quickly, now it's up to you what you do with it, add more libraries, assets, resources and get creative.\n\nThe scripts are fully commented to help you modify it as you see fit.\n\nFeel free to contribute any useful changes to the scripts or the project layout.\n\n### TODO\nSome additional things I'd like to work on:\n\n- [ ] Desktop support. Create `.jar` files runnable on desktop too.\n- [ ] Ant file. Allow the option for users to use `ant` if they wish\n\n## Related Resources\n- [Running fbx-conv on Android](https://ravener.vercel.app/posts/running-fbx-conv-on-android)\n\n## Credits\nGame is based on the [example from libGDX wiki](https://libgdx.com/wiki/start/a-simple-game) and I do not own the assets provided.\n\nAssets credits:\n\n  * water drop sound by junggle, see \u003chttp://www.freesound.org/people/junggle/sounds/30341/\u003e\n  * rain by acclivity, see \u003chttp://www.freesound.org/people/acclivity/sounds/28283/\u003e\n  * droplet sprite by mvdv, see \u003chttps://www.box.com/s/peqrdkwjl6guhpm48nit\u003e\n  * bucket sprite by mvdv, see \u003chttps://www.box.com/s/605bvdlwuqubtutbyf4x\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravener%2Flibgdx-termux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravener%2Flibgdx-termux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravener%2Flibgdx-termux/lists"}