Search code examples
javaandroidandroid-studiolibgdxandroid-wear-2.0

Is it possible to create a project using badlogic(LibGDX) without using their LibGDX project generator?


Pretty much what the title says. If it is not possible, how do I get rid of the 'core' module and other modules[like Desktop, html, and so on]that were automatically generated? I want to get rid of these because they are just taking up space and I am currently not using them. Another reason is that my game doesn't work in core because it doesn't work the dependencies I gave it, but it works in the android module. I also feel like because of these modules existing is possibly why my game doesn't run.

To give detail on what I am creating if it helps is that I created a game using LibGDX on my phone which you can play on, but if you want to use a smartwatch as a controller then you are more than welcome to do so. The functionally using the watch to phone works without LibGDX because it is a very simple game. When I try to make a somewhat complicated game using LibGDX it does not work but the game still runs.

Lastly, when I wrote some logs to see if they are actually connected when I run the app. Turns out the logs do read that the phone and watch are receiving with each other, but it does not work. Yesterday I learned that the phone and wear must have the same package name so I thought that was the issue. So, today I remade the project [in libGDX still] to see if that was the issue and it still does not work. My only thought process now is to remake the project again but without the LibGDX generator and just import com.badlogic.gdx.... to my new project and see if that works. So, that brings to my original question, is it possible to import badlogic into a new project without using their generator and if so how?


Solution

  • You can also make new projects by just copying other libGDX projects. But that will not work out for you, because all projects will have the core module. But you don't need to go this way:

    Of course you can change what modules are available for you. Just delete the unneeded ones in your file system and from your settings.gradle. Move all your code from the core to your android project before, and move the dependencies from core to your android project in your build.gradle file.

    However, you will completely loose the ability to test on desktop.